Created
June 15, 2023 07:46
-
-
Save eiennohito/3d18cf251f196ca2a5b64fc26a13e5ef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.worksap.nlp.sudachi.Config | |
import com.worksap.nlp.sudachi.DictionaryFactory | |
import com.worksap.nlp.sudachi.Tokenizer | |
import java.nio.file.Path | |
fun main() { | |
val config = Config.defaultConfig() | |
config.systemDictionary(Path.of("/path/to/system/dictionary")) | |
val dic = DictionaryFactory().create(config) | |
val tokenizer = dic.create() | |
val morphemes = tokenizer.tokenize(Tokenizer.SplitMode.C, "それは秘密です") | |
for (m in morphemes) { | |
println(m.surface()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment