How to find true words that start with a capital letter?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to find true words that start with a capital letter?

Geoff Canyon via use-livecode
Folks,
What is the most efficient way to search for trueWords starting with a capital letter?

Is there anything more direct than something like...

repeat for each true word tWord in tContainer

        If char 1 of tWord is among the codePoints of tUnicodeLetters // a variable containing A-Z  
        then put tWord into tCapitalised

end repeat

Thanks & regards,
Keith
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How to find true words that start with a capital letter?

Geoff Canyon via use-livecode
Hello Keith,

Does this work?

set the casesensitive to true

if char 1 of tWord is toUpper(char 1 of tWord) then

   answer "Found Uppercase"

end if


Best,

Panos

--

On Fri, Oct 26, 2018 at 2:22 PM Keith Clarke via use-livecode <
[hidden email]> wrote:

> Folks,
> What is the most efficient way to search for trueWords starting with a
> capital letter?
>
> Is there anything more direct than something like...
>
> repeat for each true word tWord in tContainer
>
>         If char 1 of tWord is among the codePoints of tUnicodeLetters // a
> variable containing A-Z
>         then put tWord into tCapitalised
>
> end repeat
>
> Thanks & regards,
> Keith
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How to find true words that start with a capital letter?

Geoff Canyon via use-livecode
In reply to this post by Geoff Canyon via use-livecode
You say "... containing A-Z"

Are you really using unicode ? Or is it really just ASCII ?

if so, you could do

    put char 1 of tWord into temp
    if 65 <= temp AND temp <= 90 then ...

Alex.



On 26/10/2018 12:21, Keith Clarke via use-livecode wrote:

> Folks,
> What is the most efficient way to search for trueWords starting with a capital letter?
>
> Is there anything more direct than something like...
>
> repeat for each true word tWord in tContainer
>
> If char 1 of tWord is among the codePoints of tUnicodeLetters // a variable containing A-Z
> then put tWord into tCapitalised
>
> end repeat
>
> Thanks & regards,
> Keith
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How to find true words that start with a capital letter?

Geoff Canyon via use-livecode
Thanks Alex.

The text could be Unicode or ASCII, depending on the source, so I’m assuming the former to be on the safe side.

I did think of checking the character number but whilst the ASCII range is neat, identification of Unicode capital letter codes seem to be complex.

Perhaps I’ll start with support for Latin languages, where I can at least see and understand the upper/lower case test results! :-)

Keith  

> On 26 Oct 2018, at 19:07, Alex Tweedly via use-livecode <[hidden email]> wrote:
>
> You say "... containing A-Z"
>
> Are you really using unicode ? Or is it really just ASCII ?
>
> if so, you could do
>
>    put char 1 of tWord into temp
>    if 65 <= temp AND temp <= 90 then ...
>
> Alex.
>
>
>
> On 26/10/2018 12:21, Keith Clarke via use-livecode wrote:
>> Folks,
>> What is the most efficient way to search for trueWords starting with a capital letter?
>>
>> Is there anything more direct than something like...
>>
>> repeat for each true word tWord in tContainer
>>
>> If char 1 of tWord is among the codePoints of tUnicodeLetters // a variable containing A-Z
>> then put tWord into tCapitalised
>>
>> end repeat
>>
>> Thanks & regards,
>> Keith
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode