Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #30506 > unrolled thread
| Started by | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| First post | 2014-12-08 01:21 -0500 |
| Last post | 2014-12-08 01:48 -0500 |
| Articles | 2 — 1 participant |
Back to article view | Back to comp.lang.java.programmer
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: The Grand Canyon Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 01:21 -0500
Re: The Grand Canyon Jeff Higgins <jeff@invalid.invalid> - 2014-12-08 01:48 -0500
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2014-12-08 01:21 -0500 |
| Subject | Re: The Grand Canyon |
| Message-ID | <m63g2d$9j9$1@dont-email.me> |
On 12/07/2014 06:59 PM, Stefan Ram wrote:
> Today, I saw the Grand Canyon!
>
> Say, you want to count the even numbers of a list.
> Well, that's easy, you just ...
>
>
> public class Main
> { public static void main( final java.lang.String args[] )
> { final java.util.List< java.lang.Integer >list = java.util.Arrays.asList( 1, 2, 3, 4 );
> java.lang.System.out.println( list.stream().filter( i -> 0 == i % 2 ).count() ); }}
>
> Now, say, you want to count the vowel letters in a string.
>
> public class Main
> { public static void main( final java.lang.String args[] )
> { final java.lang.String s = "alpha";
> ... x = ... s ... ;
> java.lang.System.out.println( x.stream().filter( ch -> "aeiou".contains( ch )).count() ); }}
>
> Can you fill in something for »...« to bridge the gap between
> the string and the filter counter? (The output should be »2«.)
>
> You can't.
>
> So, this is not just a gap, it's a canyon.
>
> The Grand Canyon of Java programming!
>
So, after much study, I conclude you will:
For each language, and dialect of that language;
Construct a word->IPA transcription dictionary:
Split the string into words:
Map the words to their IPA transcription:
Filter the vowels from the transcriptions:
Reduce to a vowel count.
Voilà! vwäˈlä
[toc] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2014-12-08 01:48 -0500 |
| Message-ID | <m63hkh$d0r$1@dont-email.me> |
| In reply to | #30506 |
I never cease to be amazed at how people spend their time. <http://www.atlas.mouton-content.com/> <http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3350735/>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web