马拉雅拉姆形态分析仪
mlmorph的Python项目详细描述
这是Malayalam morphology analyser - mlmorph的python接口。
用法
形态分析示例
frommlmorphimportAnalyseranalyser=Analyser()analyser.analyse("കേരളത്തിന്റെ")
给出
[('കേരളം<np><genitive>',179)]
这个结果中的第二项是重量。有时一个单词可以有多个分析。重量轻的分析是首选的分析方法。
形态生成器示例
frommlmorphimportGeneratorgenerator=Generator()generator.generate("കേരളം<np><genitive>")
给出
(('കേരളത്തിന്റെ',0.0),)
命令行界面
$ python -m mlmorph --help usage: __main__.py [-h] [-i INFILE] [-a] [-g] [-v] optional arguments: -h, --help show this help message and exit -i INFILE, --input INFILE source of analysis data -a, --analyse Analyse the input file strings -g, --generate Generate the input file strings -v, --verbose print verbosely while processing
也接受来自stdin的字符串。例如:
$ python -m mlmorph -a നിറങ്ങൾ നിറങ്ങൾ നിറം<n><pl>