how to delete ponctuation in a textfield

Christian Langers christian.langers at education.lu
Thu Jan 19 16:06:01 EST 2006


Hi Jonathan,

I tried your functions and I think they are pretty ccol for small  
texts...

I work with texts over 30 000 words...

I tried this (after some research) :

put "~!@#$%^&*()><.`?/{}’[]|\=-_–'°§…“‘" into tPoncts

     repeat for each char thisChar in tPoncts
     	replace thisChar with empty in tVar
     end repeat
     replace quote with empty in tVar
     replace comma with empty in tVar

which speeded up the filtering;

I think : filter ... with "[A-Z0-9]" does the same thing but it  
depends (eg. Hello' is return as it is)


thanks for your input ;-)


Christian


Le 19 janv. 06 à 20:43, Lynch, Jonathan a écrit :

> You are going to get a million different approaches to how to do  
> this...
>
> Do you wish to exclude certain particular bits of punctuation, or  
> do you
> wish to include only characters that are letters and numbers?
>
> Here is a function for the inclusion approach:
>
>
> Function NumCharOnly pText
>   Repeat for each char tChar in pText
>     If tChar is in "abcdefghijklmnopqrstuvwxyz1234567890" then
>       Put tChar after tReturnText
>     End if
>   End repeat
>   Return tReturnText
> End NumCharOnly
>
>
>
> Here is a function for the exclusion approach:
>
>
> Function ExcludePunct pText
>   Repeat for each char tChar in pText
>     If tChar is not in "~!@#$%^&*()><.,`?/{}[]|\=-_" and tChar <>  
> quote
> then
>       Put tChar after tReturnText
>     End if
>   End repeat
>   Return tReturnText
> End ExcludePunct
>
>
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of  
> Christian
> Langers
> Sent: Thursday, January 19, 2006 2:27 PM
> To: use-revolution use Revolution
> Subject: how to delete ponctuation in a textfield
>
> Does anybody know how to remove any ponctuation from text ?
>
> any regex filtering ?
>
> Thanks in advance,
>
>
> Christian
>
> Luxembourg
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list