识别perl中的单词

问题描述 投票:0回答:1

我正在尝试浏览一个文件列表,这些文件中包含单词并将单词分开。

my @file_list = (
    'myfirstperlfile.pl',
    'mashpotatorecipes.pl',
    'badhaircuts.pl',
    'jonisntverygoodatsoftball.pl',
    'thatnewcomedianislol.pl',
);

我的列表可以用任何东西描述,但为了示例,它可能看起来像这样。

my @delineated_file_list = (
    'my first perl file',
    'mash potato recipes',
    'bad haircuts',
    'jon isnt very good at soft ball',
    'that new comedian is lol',
);        

在我的特定情况下,有很多文件,所以寻找静态单词并不理想。

知道我的perl最好的是,首先,perl和文件是单独的单词?我也担心识别缩写,拼写错误或假字。

arrays string perl
1个回答
2
投票

如果不开发人工智能,你不太可能找到完美的解决方案。但是首先你需要一个知道英语单词的模块,所以请查看Lingua::EN名称空间。 Lingua::EN::Segment看起来与您的用例类似。

© www.soinside.com 2019 - 2024. All rights reserved.