Commit 8e83e850 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

split by more punctuations to avode crazy long lines.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44494 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6d3f995d
......@@ -104,9 +104,11 @@ def getExcerptText(context, txt, sw, tags, trail, maxlines):
txt = re.sub(r,'',txt)
r = re.compile('<([^>]+)>',re.DOTALL|re.IGNORECASE)
txt = re.sub(r,'',txt)
txt = txt.replace('-',' - ') # to find hyphenated occurrences
txt = txt.replace(',',', ')
txt = txt.replace(';','; ')
r = re.compile('\s+')
txt = re.sub(r,' ',txt)
txt = txt.replace('-',' - ') # to find hyphenated occurrences
text = ' '.join(txt.split('\n')).split(' ') # very rough tokenization
return [p for p in generateParts(context,text,sw,tags,trail,maxlines)]
......
40937
\ No newline at end of file
40938
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment