flesh out toki stuff to allow for reverse lookups

This commit is contained in:
Aaron Bieber 2020-04-08 08:01:41 -06:00
parent e1d3666dcd
commit 957d826bfa
4 changed files with 1720 additions and 82 deletions

1
go.mod
View File

@ -3,6 +3,7 @@ module suah.dev/mcchunkie
go 1.13 go 1.13
require ( require (
github.com/caneroj1/stemmer v0.0.0-20170128035808-c9f2ce1504d5
github.com/gomarkdown/markdown v0.0.0-20200127000047-1813ea067497 github.com/gomarkdown/markdown v0.0.0-20200127000047-1813ea067497
github.com/google/btree v1.0.0 // indirect github.com/google/btree v1.0.0 // indirect
github.com/matrix-org/gomatrix v0.0.0-20200128155335-9e7906b6766d github.com/matrix-org/gomatrix v0.0.0-20200128155335-9e7906b6766d

2
go.sum
View File

@ -1,3 +1,5 @@
github.com/caneroj1/stemmer v0.0.0-20170128035808-c9f2ce1504d5 h1:KrgIOxLMw9OvGiPOX1WlxUOZzhJ6NvslCVEMb3SrIXQ=
github.com/caneroj1/stemmer v0.0.0-20170128035808-c9f2ce1504d5/go.mod h1:FX8SGAdUYnFYgGoy+xeGdnVIEq/ITKM7iMewnmng4Y4=
github.com/gomarkdown/markdown v0.0.0-20200127000047-1813ea067497 h1:wJkj+x9gPYlDyM34C6r3SXPs270coWeh85wu1CsusDo= github.com/gomarkdown/markdown v0.0.0-20200127000047-1813ea067497 h1:wJkj+x9gPYlDyM34C6r3SXPs270coWeh85wu1CsusDo=
github.com/gomarkdown/markdown v0.0.0-20200127000047-1813ea067497/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= github.com/gomarkdown/markdown v0.0.0-20200127000047-1813ea067497/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU=
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=

File diff suppressed because it is too large Load Diff

View File

@ -15,13 +15,20 @@
END { END {
for (w in words) { for (w in words) {
split(words[w], pnd, "#")
print "\""w"\": []Toki{" print "\""w"\": []Toki{"
split(words[w], pnd, "#")
for (p in pnd) {
split(pnd[p], a, "$")
pos = a[2]
meanings = a[3]
if (pos != "") {
print "\tToki{" print "\tToki{"
split(pnd[2], a, "$")
print "\t\tPOS: " "\""a[2]"\"," print "\t\tPOS: " "\"" pos "\","
split(a[3], b, ",")
print "\t\tMeanings: []string{" print "\t\tMeanings: []string{"
split(meanings, b, ",")
for (x in b) { for (x in b) {
gsub(/ $/, "", b[x]); gsub(/ $/, "", b[x]);
gsub(/^ /, "", b[x]); gsub(/^ /, "", b[x]);
@ -29,6 +36,9 @@ END {
} }
print "\t\t}," print "\t\t},"
print "\t}," print "\t},"
}
}
print "}," print "},"
} }
} }