[Erp5-report] r10722 - /erp5/trunk/bt5/erp5_dms/ExtensionTemplateItem/cutFound.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Sat Oct 14 16:47:52 CEST 2006
Author: bartek
Date: Sat Oct 14 16:47:51 2006
New Revision: 10722
URL: http://svn.erp5.org?rev=10722&view=rev
Log:
find hyphenated occurrences
fixed debugging function
Modified:
erp5/trunk/bt5/erp5_dms/ExtensionTemplateItem/cutFound.py
Modified: erp5/trunk/bt5/erp5_dms/ExtensionTemplateItem/cutFound.py
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/ExtensionTemplateItem/cutFound.py?rev=10722&r1=10721&r2=10722&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/ExtensionTemplateItem/cutFound.py (original)
+++ erp5/trunk/bt5/erp5_dms/ExtensionTemplateItem/cutFound.py Sat Oct 14 16:47:51 2006
@@ -75,6 +75,7 @@
txt=re.sub(r,'',txt)
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)]
@@ -88,8 +89,7 @@
tags=('<b>','</b>')
trail=5
maxlines=5
- sw=sw.split()
- for p in cutFound(txt,sw,tags,trail,maxlines):
+ for p in cutFound(None,txt,sw,tags,trail,maxlines):
print p
More information about the Erp5-report
mailing list