[英]Determine word boundaries in a python string
我有以下格式的文件路徑:
THISISSOMEMOVIE.mov
是否有一些 NLP 庫可以對字符串中的單詞邊界進行非常有根據的/統計猜測? 例如,上面應該被解析為:
THIS IS SOME MOVIE mov
我不知道有一個庫可以做到這一點,但你可以使用PyEnchant來告訴你一個詞是否屬於字典。
所以這是我要做的偽代碼:
s = 0
i = len(title) - 1
check if the substring s-i is in the dictionary
if not i = i - 1
if yes then s becomes i+1, and i = len(title) - 1 again
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.