Thanks, John. It is exactly what I need.

-----Original Message-----
From: John Benediktsson [mailto:mrj...@gmail.com] 
Sent: Tuesday, January 04, 2011 12:03 PM
To: factor-talk@lists.sourceforge.net
Subject: Re: [Factor-talk] Count repetition in sequence

Try:

( scratchpad ) USE: math.statistics
( scratchpad ) { "a" "a" "a" "cc" "cc" "def" } histogram .
H{ { "cc" 2 } { "a" 3 } { "def" 1 } }


2011/1/3 Steve Tsai 蔡福安 <tsa...@familysearch.org>:
> I want to define a word that can count the number of repetition of elements
> in a sorted sequence.
>
> For example
>
> Input: { “a” “a” “a” “cc” “cc” “def” }
>
> Output: { { “a” 3 } { “cc” 2 } { “def” 1 } }
>
>
>
> Can anyone guide me on it?
>
>
>
> Thanks,
>
> Steve Tsai
>


 NOTICE: This email message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email and destroy all 
copies of the original message.


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to