【发布时间】:2021-10-23 12:29:22
【问题描述】:
使用 Python,我想在一个短字符串列表(从 1 到大约 50 个单词)中识别法语文本,否则它们是英文的。
输入数据示例(此处输入字符串以逗号分隔):
year of the snake, legendary 'dragon horse', thunder, damsel-fly, larvae of mosquito,
treillage, libellule, mythical water creature, petites chevrettes, de papillon hideux,
the horse-fly, 5th earthly branch, dragon, mythical creature,
a shore plant whose leaves dry a bright orange, dragon horse, god of rain, year of the dragon,
orthopteran, crocodile, dont le duvet des ailes s'en va en poussière, insecte, dragonfly,
dracontomelon vitiense, dragon king, petit filet pour une espèce de papillon, sorte d'insecte
理想情况下,我想使用已经构建好的库,因为我知道这是一个难题。但是,我最熟悉的Python中的自然语言库nltk,似乎没有这个能力,或者如果有,我也没找到。
我知道识别一两个单词可能非常困难,我宁愿误报(法语误认为英语)也不愿误报。
【问题讨论】: