|
From: creecode <icr...@us...> - 2006-03-07 05:46:20
|
Update of /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/search/utilities In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10061 Modified Files: cleanText Log Message: replace calls to verbs at extensions.latinToMac with string.(latin/mac)To(Latin/Mac) verbs Index: cleanText =================================================================== RCS file: /cvsroot/frontierkernel/odbs/mainResponderRoot/mainResponder/search/utilities/cleanText,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** cleanText 26 Mar 2005 21:46:13 -0000 1.1.1.1 --- cleanText 7 Mar 2006 05:46:16 -0000 1.2 *************** *** 1,3 **** ! FrontierVcsFile:1:scpt:mainResponder.search.utilities.cleanText ! on cleanText (s) { ÇPrepare text to be indexed. ÇReplace whitespace characters and punctuation with spaces. Ç(Don't replace #, <, >, {, and } characters.) ÇThen strip HTML tags and macros. ÇChanges Ç8/2/02; 5:18:49 PM by JES ÇUse string.multipleReplaceAll, if available. if defined (string.multipleReplaceAll) { local (replchars = "\r\n\t.-\\/:?!;@$%^&*)([]"); local (t); new (tableType, @t); local (i, ch, ct=sizeOf (replchars)); for i = 1 to ct { t.[replchars[i]] = " "}; s = string.multipleReplaceAll (s, @t)} else { //replace characters one at a time -- original behavior s = string.replaceAll (s, "\r", " "); s = string.replaceAll (s, "\n", " "); s = string.replaceAll (s, "\t", " "); s = string.replaceAll (s, ".", " "); s = string.replaceAll (s, "-", " "); s = string.replaceAll (s, "\\", " "); s = string.replaceAll (s, "/", " "); s = string.replaceAll (s, ":", " "); s = string.replaceAll (s, "?", " "); s = string.replaceAll (s, "!", " "); s = string.replaceAll (s, ";", " "); s = string.replaceAll (s, "@", " "); s = string.replaceAll (s, "$", " "); s = string.replaceAll (s, "%", " "); s = string.replaceAll (s, "^", " "); s = string.replaceAll (s, "&", " "); s = string.replaceAll (s, "*", " "); s = string.replaceAll (s, ")", " "); s = string.replaceAll (s, "(", " "); s = string.replaceAll (s, "[", " "); s = string.replaceAll (s, "]", " ")}; s = searchEngine.stripMarkup (s); //strip HTML tags and macros if system.environment.isMac { s = latinToMac.convert (s)}; //convert Latin to Mac characters return (s)}; Çbundle //test code ÇmainResponder.search.utilities.cleanText ("foo-bar's bim!") Ç"foo bar's bim " \ No newline at end of file --- 1,54 ---- ! FrontierVcsFile:2:scpt:mainResponder.search.utilities.cleanText ! on cleanText (s) { ! «Changes ! «2/28/06; 11:54:00 AM by TAC ! «replace extensions.latinToMac.convert with string.latinToMac ! «8/2/02; 5:18:49 PM by JES ! «Use string.multipleReplaceAll, if available. ! «Prepare text to be indexed. ! «Replace whitespace characters and punctuation with spaces. ! «(Don't replace #, <, >, {, and } characters.) ! «Then strip HTML tags and macros. ! ! if defined (string.multipleReplaceAll) { ! local (replchars = "\r\n\t.-\\/:?!;@$%^&*)([]"); ! local (t); new (tableType, @t); ! local (i, ch, ct = sizeOf (replchars)); ! ! for i = 1 to ct { ! t.[replchars [i]] = " "}; ! s = string.multipleReplaceAll (s, @t)} ! else { //replace characters one at a time -- original behavior ! s = string.replaceAll (s, "\r", " "); ! s = string.replaceAll (s, "\n", " "); ! s = string.replaceAll (s, "\t", " "); ! s = string.replaceAll (s, ".", " "); ! s = string.replaceAll (s, "-", " "); ! s = string.replaceAll (s, "\\", " "); ! s = string.replaceAll (s, "/", " "); ! s = string.replaceAll (s, ":", " "); ! s = string.replaceAll (s, "?", " "); ! s = string.replaceAll (s, "!", " "); ! s = string.replaceAll (s, ";", " "); ! s = string.replaceAll (s, "@", " "); ! s = string.replaceAll (s, "$", " "); ! s = string.replaceAll (s, "%", " "); ! s = string.replaceAll (s, "^", " "); ! s = string.replaceAll (s, "&", " "); ! s = string.replaceAll (s, "*", " "); ! s = string.replaceAll (s, ")", " "); ! s = string.replaceAll (s, "(", " "); ! s = string.replaceAll (s, "[", " "); ! s = string.replaceAll (s, "]", " ")}; ! ! s = searchEngine.stripMarkup (s); //strip HTML tags and macros ! ! if system.environment.isMac { ! s = string.latinToMac (s)}; //convert Latin to Mac characters ! ! return (s)}; ! ! «bundle // testing ! «mainResponder.search.utilities.cleanText ("foo-bar's bim!") ! «"foo bar's bim " \ No newline at end of file |