Skip to content

Commit

Permalink
add croatian, serbian
Browse files Browse the repository at this point in the history
  • Loading branch information
neurlang authored and Your Name committed Dec 19, 2024
1 parent 3f387b2 commit 0b594a3
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dicts/croatian/language.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package croatian

import "embed"

//go:embed *.tsv language.json weights1.json.lzw
var Language embed.FS
33 changes: 33 additions & 0 deletions dicts/croatian/language.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{"Map":{"a":["a","ǎ","","ǎː","â","âː"],
"b":["b"],
"c":["ts"],
"d":["d","t"],
"e":["e","ě","ê","","ěː","êː"],
"f":["f"],
"g":["ɡ"],
"h":["x"],
"i":["i","","ǐ","ǐː","î","îː"],
"j":["j","ʒ"],
"k":["k"],
"l":["l"],
"lj":["ʎ"],
"m":["m"],
"n":["n"],
"nj":["ɲ","nj"],
"o":["o","ǒ","","ô","ǒː","ôː"],
"p":["p"],
"r":["r","ř","","řː","","r̂ː",""],
"s":["s"],
"t":["t"],
"u":["u","ǔ","û","ǔː","","ûː"],
"v":["ʋ","v"],
"z":["z"],
"ć":[""],
"č":[""],
"đ":[""],
"š":["ʃ"],
"ź":["ʑ"],
"ž":["ʒ"]}
,"SrcMulti":null,"DstMulti":null,"SrcMultiSuffix":null,"DstMultiSuffix":["ː"],
"DstMultiPrefix":["ˈ","'","ˌ"],
"DropLast":null,"SplitBefore":null,"SplitAfter":null,"PrePhonWordSteps":[{"Trim":".,"},{"ToLower":true}]}
Empty file added dicts/croatian/missing.tsv
Empty file.
Binary file added dicts/croatian/weights1.json.lzw
Binary file not shown.
6 changes: 6 additions & 0 deletions dicts/dicts.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ import "github.com/neurlang/goruut/dicts/thai"
import "github.com/neurlang/goruut/dicts/zulu"
import "github.com/neurlang/goruut/dicts/catalan"
import "github.com/neurlang/goruut/dicts/armenian"
import "github.com/neurlang/goruut/dicts/croatian"
import "github.com/neurlang/goruut/dicts/serbian"
import "errors"

var ErrUnsupportedLanguage = errors.New("unsupportedLang")
Expand Down Expand Up @@ -241,6 +243,10 @@ func GetDict(lang, filename string) ([]byte, error) {
return catalan.Language.ReadFile(filename)
case "Armenian":
return armenian.Language.ReadFile(filename)
case "Croatian":
return croatian.Language.ReadFile(filename)
case "Serbian":
return serbian.Language.ReadFile(filename)
default:
return nil, ErrUnsupportedLanguage
}
Expand Down
6 changes: 6 additions & 0 deletions dicts/serbian/language.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package serbian

import "embed"

//go:embed *.tsv language.json weights1.json.lzw
var Language embed.FS
35 changes: 35 additions & 0 deletions dicts/serbian/language.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{"Map":{"а":["a","ǎ","","ǎː","â","âː"],
"б":["b"],
"в":["ʋ","v"],
"г":["ɡ"],
"д":["d"],
"е":["e","ě","ê","","ěː","êː"],
"ж":["ʒ"],
"з":["z"],
"з́":["ʑ"],
"и":["i","","ǐ","ǐː","î","îː"],
"к":["k"],
"л":["l"],
"м":["m"],
"н":["n"],
"о":["o","ǒ","","ô","ǒː","ôː"],
"п":["p"],
"р":["r","ř","","řː","","r̂ː",""],
"с":["s"],
"с́":["ɕ"],
"т":["t"],
"у":["u","ǔ","û","ǔː","","ûː"],
"ф":["f"],
"х":["x","k"],
"ц":["ts"],
"ч":[""],
"ш":["ʃ"],
"ђ":[""],
"ј":["j","ʒ"],
"љ":["ʎ"],
"њ":["ɲ"],
"ћ":[""],
"џ":[""]}
,"SrcMulti":null,"DstMulti":null,"SrcMultiSuffix":null,"DstMultiSuffix":["ː"],
"DstMultiPrefix":["ˈ","'","ˌ"],
"DropLast":null,"SplitBefore":null,"SplitAfter":null,"PrePhonWordSteps":[{"Trim":".,"},{"ToLower":true}]}
Empty file added dicts/serbian/missing.tsv
Empty file.
Binary file added dicts/serbian/weights1.json.lzw
Binary file not shown.

0 comments on commit 0b594a3

Please sign in to comment.