回复: BFSU Sentence Collector 1.0 基于语料库的英语例句提取工具
	
		
	
	
		
		
			Thanks for your reply......
		
		
	 
SC1.0使用的正则表达式不完全是PCRE(Perl Compatible Regular Expressions),CS支持通用的正则表达式语法:
第一类:
1.    \	Quote the next metacharacter
2.    ^	Match the beginning of the line
3.    .	Match any character (except newline)
4.    $	Match the end of the line (or before newline at the end)
5.    |	Alternation
6.    ()	Grouping
7.    []	Character class
第二类:
1.    *	   Match 0 or more times
2.    +	   Match 1 or more times
3.    ?	   Match 1 or 0 times
4.    {n}    Match exactly n times
5.    {n,}   Match at least n times
6.    {n,m}  Match at least n but not more than m times
第三类:
1.    \w	     Match a "word" character (alphanumeric plus "_")
2.    \W	     Match a non-"word" character
3.    \s	     Match a whitespace character
4.    \S	     Match a non-whitespace character
5.    \d	     Match a digit character
6.    \D	     Match a non-digit character
数据量较大时,正则表达式检索效率会很低。一般通过索引技术,先将检索范围缩小,然后再使用正则表达式,这也是SC1.0的思想。对于大型语料库,如纯文本达到100M以上,使用正则表示查询是不现实的,效率会非常低。一般我们会使用搜索引擎技术,通过索引实现,lucene和sphinx都是不错的选择,可以轻松完成对GB级数据的检索。