Giter Site home page Giter Site logo

jmorphy2's Introduction

Java CI Appveyor status

Jmorphy2

Java port of the pymorphy2

Clone project:

git clone https://github.com/anti-social/jmorphy2
cd jmorphy2

Compile project, build jars and run tests:

Build with vagga (no java and gradle needed):

vagga build
./gradlew build

To see all available vagga commands just type vagga

Elasticsearch plugin

Plugin installation

# Specify correct path of your Elasticsearch installation
export es_home=/usr/share/elasticsearch
${es_home}/bin/elasticsearch-plugin install "https://bintray.com/evo/elasticsearch/download_file?file_path=analysis-jmorphy2-0.2.2-es7.9.2.zip"

Building plugin

Default elasticsearch version against which plugin is built is 7.9.2

To build for specific elastisearch version run build as:

vagga assemble -PesVersion=6.7.1

Or:

./gradlew assemble -PesVersion=6.7.1

Supported elasticsearch versions: 6.6.x, 6.7.x, 6.8.x, 7.0.x, 7.1.x, 7.2.x, 7.3.x, 7.4.x, 7.5.x, 7.6.x, 7.7.x, 7.8.x and 7.9.x

For older elasticsearch version use specific branches:

  • es-5.4 for Elasticsearch 5.4.x, 5.5.x and 5.6.x
  • es-5.1 for Elasticsearch 5.1.x, 5.2.x and 5.3.x

And install assembled plugin:

# Specify correct path of your Elasticsearch installation
export es_home=/usr/share/elasticsearch
sudo ${es_home}/bin/elasticsearch-plugin install file:jmorphy2-elasticsearch/build/distributions/analysis-jmorphy2-0.2.2-SNAPSHOT-es7.9.2.zip

Or just run elasticsearch inside the container (only works for plugin built for default Elasticsearch version):

# build container and run elasticsearch with jmorphy2 plugin
vagga elastic

Test elasticsearch with jmorphy2 plugin

Create index with specific analyzer and test it:

curl -X PUT -H 'Content-Type: application/yaml' 'localhost:9200/test_index' -d '---
settings:
  index:
    analysis:
      filter:
        delimiter:
          type: word_delimiter
          preserve_original: true
        jmorphy2_russian:
          type: jmorphy2_stemmer
          name: ru
        jmorphy2_ukrainian:
          type: jmorphy2_stemmer
          name: uk
      analyzer:
        text_ru:
          tokenizer: standard
          filter:
          - delimiter
          - lowercase
          - jmorphy2_russian
        text_uk:
          tokenizer: standard
          filter:
          - delimiter
          - lowercase
          - jmorphy2_ukrainian
'

# Test russian analyzer
curl -X GET -H 'Content-Type: application/yaml' 'localhost:9200/test_index/_analyze' -d '---
analyzer: text_ru
text: Привет, лошарики!
'
curl -X GET -H 'Content-Type: application/yaml' 'localhost:9200/test_index/_analyze' -d '---
analyzer: text_ru
text: ёж еж ежики
'

# Test ukrainian analyzer
curl -X GET -H 'Content-Type: application/yaml' 'localhost:9200/test_index/_analyze' -d '---
analyzer: text_uk
text: Пригоди Котигорошка
'
curl -X GET -H 'Content-Type: application/yaml' 'localhost:9200/test_index/_analyze' -d '---
analyzer: text_uk
text: їжаки
'
curl -X GET -H 'Content-Type: application/yaml' 'localhost:9200/test_index/_analyze' -d '---
analyzer: text_uk
text: комп\'ютером
'

jmorphy2's People

Contributors

anti-social avatar maksaimer avatar kirillpampam avatar genme avatar

Stargazers

 avatar Svetlana avatar Nikita avatar  avatar Marat116 avatar Burito avatar Vasyl avatar  avatar Luckygrandpa  avatar Ph0eniXsa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.