Skip to content

Commit

Permalink
Add RU
Browse files Browse the repository at this point in the history
  • Loading branch information
d1slike committed Nov 10, 2021
1 parent 62386da commit 7b30f3e
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 8 deletions.
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LANG=en
all:
# go get -u github.com/jteeuwen/go-bindata/...
mkdir -p data
$(MAKE) en sv fr es de it
$(MAKE) en sv fr es de it ru

package-all:
$(MAKE) LANG=en package
Expand All @@ -13,26 +13,31 @@ package-all:
$(MAKE) LANG=es package
$(MAKE) LANG=de package
$(MAKE) LANG=it package

en:
$(MAKE) LANG=ru package

en:
$(MAKE) LANG=en download package
sv:
sv:
$(MAKE) LANG=sv download package
fr:
fr:
$(MAKE) LANG=fr download package
es:
es:
$(MAKE) LANG=es download package
de:
de:
$(MAKE) LANG=de download package
it:
it:
$(MAKE) LANG=it download package
ru:
$(MAKE) LANG=ru download package

download:
mkdir -p data
curl https://raw.githubusercontent.com/michmech/lemmatization-lists/master/lemmatization-$(LANG).txt > data/$(LANG)

package:
# Packaging $(LANG)
go run cmd/simplify/simplify.go data/$(LANG) data/$(LANG).gz
mkdir -p v4/dicts/$(LANG)
go run cmd/genpack/genpack.go -locale $(LANG) -path data/$(LANG).gz > v4/dicts/$(LANG)/pack.go
# ----------------

Expand Down
5 changes: 5 additions & 0 deletions v4/dicts/ru/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/aaaton/golem/v4/dicts/ru

go 1.17

require github.com/aaaton/golem/v4 v4.0.1
42 changes: 42 additions & 0 deletions v4/dicts/ru/pack.go

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions v4/dicts/ru/ru_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package ru

import (
"testing"

"github.com/aaaton/golem/v4"
)

func TestItalian(t *testing.T) {
lem, err := golem.New(New())
if err != nil {
t.Fatal(err)
}
result := "выходить"
lemma := lem.Lemma("выходят")
if lemma != result {
t.Errorf("Expected %v, but got %v", result, lemma)
}

}

0 comments on commit 7b30f3e

Please sign in to comment.