计算两个字符串之间的单词和短语的最佳方法是什么?

时间:2016-05-17 14:27:09

标签: perl split

我有一个xml文件,其中包含两种类型的标记。

我想计算两个不同标签之间的单词和句子数量。我想使用“拆分”,但我不知道是否还有其他更好的方法。 例如:

 Schemas.Cources = new SimpleSchema({});
 Cources.attachSchema(Schemas.Cources);

所以结果应该是这样的:

<tagX id="1">Lorem</tagX> Ipsum is simply dummy text of the printing and setting 
industry. 
<tagY equal="1">Lorem </tagY> been the industry's standard dummy text ever since
the 1500s, when an unknown printer took a <tagX id="2">galley</tagX>word book. 
<tagY equal="2">It</tagY> has survived not only five centuries, but also the leap 
into electronic, remaining essentially unchanged. <tagY equal="2">It</tagY> was 
popularised in the 1960s with...

谢谢!

0 个答案:

没有答案
相关问题