morph

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2020 License: GPL-3.0 Imports: 11 Imported by: 2

README

morph License GoDoc Build Status

A morphological analyzer for Russian language, using dictionaries from pymorphy2.

Install

The package:

go get -u github.com/opennota/morph

And the dictionaries:

pip install --user pymorphy2-dicts-ru

Use

package main
import (
    "fmt"
    "github.com/opennota/morph"
)
func main() {
    words, norms, tags := morph.Parse("все")
    for i := range words {
        fmt.Printf("%-4s %-5s %s\n", words[i], norms[i], tags[i])
    }
}

Output:

все  весь  ADJF,Subx,Apro plur,nomn
все  весь  ADJF,Subx,Apro inan,plur,accs
всё  всё   PRCL
всё  весь  ADJF,Subx,Apro neut,sing,nomn
всё  весь  ADJF,Subx,Apro neut,sing,accs

Documentation

Overview

Package morph provides a simple morphological analyzer for Russian language, using the compiled dictionaries from pymorphy2.

Example
words, norms, tags := Parse("криком")
for i := range words {
	fmt.Println(words[i], norms[i], tags[i])
}
Output:

криком крик NOUN,inan,masc sing,ablt

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

func Parse

func Parse(word string) (words []string, norms []string, tags []string)

Parse analyzes the word and returns three slices of the same length. Each triple (words[i], norms[i], tags[i]) represents an analysis, where: - words[i] is the word with the letter ё fixed; - norms[i] is the normal form of the word; - tags[i] is the grammatical tag, consisting of the word's grammemes.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL