Skip to content
CGo bindings to Yandex.Mystem
Branch: master
Clone or download
Latest commit d2c6010 Oct 5, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Aug 30, 2016
.travis.yml Add goveralls Sep 11, 2016
LICENSE Initial commit Aug 30, 2016
README.md Update README.md Oct 5, 2016
constants.go Stem & flex grammemes support Sep 10, 2016
mystem.go DRY Sep 11, 2016
mystem.h Initial commit Sep 10, 2016
mystem_test.go Lemma forms support Sep 11, 2016

README.md

go-mystem Build Status GoDoc Go Report Card Coverage Status

CGo bindings to Yandex.Mystem - russian morphology analyzer.

Install

$ wget https://github.com/yandex/tomita-parser/releases/download/v1.0/libmystem_c_binding.so.linux_x64.zip
$ unzip libmystem_c_binding.so.linux_x64.zip
$ sudo cp libmystem_c_binding.so /usr/lib/
$ sudo ln -s /usr/lib/libmystem_c_binding.so /usr/lib/libmystem_c_binding.so.1
$ go get -u github.com/dveselov/mystem

Usage

package main

import (
    "fmt"
)

import "github.com/dveselov/mystem"

func main() {
    analyses := mystem.NewAnalyses("маша")
    defer analyses.Close()
    fmt.Println(fmt.Sprintf("Analyze of '%s':", "маша"))
    for i := 0; i < analyses.Count(); i++ {
        lemma := analyses.GetLemma(i)
        grammemes := lemma.StemGram()
        fmt.Println(fmt.Sprintf("%d. %s - %v", i+1, lemma.Text(), grammemes))
    }
}

Output'll looks like this:

Analyze of 'маша':
1. маша - [136 155 191 201]
2. махать - [137 196 206]

License

Source code of go-mystem is licensed under MIT license, but Yandex.Mystem have their own EULA (allows commercial use), that you must accept.

You can’t perform that action at this time.