DaveLinger Posted June 10, 2009 Share Posted June 10, 2009 So I was having a discussion with a friend of mine about a song called I-E-A-I-A-I-O. I read somewhere that one proposed meaning of the title is that it represents the vowels in the word I-D-E-A-L-I-Z-A-T-I-O-N. He said that it doesn't matter cause probably lots of words meet the criteria. I, however, think that VERY few words meet the criteria of having this specific 7-character vowel combination IN ORDER with no extra vowels at all. So... I want to know now! Haha. So first, does anyone know of any database or xls or text file that I can try this with? The less abridged the better. Second, how would I go about it? There can be any number of characters between the vowels, but none of those characters can be vowels - and they have to be in order, and there can't be any extra vowels. Quote Link to comment https://forums.phpfreaks.com/topic/161713-odd-request-checking-a-dictionary-filedatabase-for-words-meeting-criteria/ Share on other sites More sharing options...
byte1918 Posted June 10, 2009 Share Posted June 10, 2009 So I was having a discussion with a friend of mine about a song called I-E-A-I-A-I-O. I read somewhere that one proposed meaning of the title is that it represents the vowels in the word I-D-E-A-L-I-Z-A-T-I-O-N. He said that it doesn't matter cause probably lots of words meet the criteria. I, however, think that VERY few words meet the criteria of having this specific 7-character vowel combination IN ORDER with no extra vowels at all. So... I want to know now! Haha. So first, does anyone know of any database or xls or text file that I can try this with? The less abridged the better. Second, how would I go about it? There can be any number of characters between the vowels, but none of those characters can be vowels - and they have to be in order, and there can't be any extra vowels. I'm sry, I am very aware that these are the php help boards but IMHO this sort of question is better solved with a perl script.. asuming you have a file (which contains text) of all the words in the english dictionary you can use this scrip to search for them... #!C:\Perl64\bin\perl.exe -w $dir = <STDIN>; chomp $dir; open F,"<",$dir or die $!; while ($line = <F>){ chomp $line; if ($line =~ /(.*i.*e.*a.*i.*a.*i.*o.*)/i) { print $i++,": ",$1,"\n"; } } exp of text file: ieaiaio idealization next word etc. result: 0: ieaiaio 1: idealization Quote Link to comment https://forums.phpfreaks.com/topic/161713-odd-request-checking-a-dictionary-filedatabase-for-words-meeting-criteria/#findComment-853249 Share on other sites More sharing options...
DaveLinger Posted June 10, 2009 Author Share Posted June 10, 2009 I have no experience with perl, but from what I can see, there's nothing in the script preventing extra vowels from being present. Is that true or am I reading it wrong? Quote Link to comment https://forums.phpfreaks.com/topic/161713-odd-request-checking-a-dictionary-filedatabase-for-words-meeting-criteria/#findComment-853263 Share on other sites More sharing options...
byte1918 Posted June 10, 2009 Share Posted June 10, 2009 I have no experience with perl, but from what I can see, there's nothing in the script preventing extra vowels from being present. Is that true or am I reading it wrong? oops must of missed that this are the words I've found.. idealization idealizations linearization illegalization indefatigation liberalisation liberalization mineralization interlamination internalization liberalizations InterApplication deliberalization demineralization interapplication semihepatization sentimentalization trade-liberalization the dictionary was taken from here : ftp://ftp.ox.ac.uk/pub/wordlists/american/ this is the code I used.. in case anyone cares.. #!C:\strawberry\perl\bin #i read the dir , because it contained more than one file opendir DIR,"dex"; while ($line =readdir(DIR)){ if ($line ne /.+/){ push @array,$line; #I remember all file names in @array } } #i remove first two values of the array which are "." and ".." shift(@array); shift(@array); open TOTAL ,">dex.txt"; #checking everyfile.. foreach $val (@array){ open F,"<","dex/".$val; while ($line=<F>){ if ($line =~ /[bcdfghjklmnpqrstxyz]*i[bcdfghjklmnpqrstxyz]*e[bcdfghjklmnpqrstxyz]*a[bcdfghjklmnpqrstxyz]*i[bcdfghjklmnpqrstxyz]*a[bcdfghjklmnpqrstxyz]*i[bcdfghjklmnpqrstxyz]*o[bcdfghjklmnpqrstxyz]*/i){ print TOTAL $line,"\n"; } } close F; } Quote Link to comment https://forums.phpfreaks.com/topic/161713-odd-request-checking-a-dictionary-filedatabase-for-words-meeting-criteria/#findComment-853270 Share on other sites More sharing options...
DarkSuperHero Posted June 10, 2009 Share Posted June 10, 2009 reg ex is the real powerhouse behind this solution.... PHP could have done this in a very similar fashion, using file(); and then preg_match(); .... but yeah def solved now i feel... I would post a php script but im short on time right now... Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/161713-odd-request-checking-a-dictionary-filedatabase-for-words-meeting-criteria/#findComment-853301 Share on other sites More sharing options...
DaveLinger Posted June 11, 2009 Author Share Posted June 11, 2009 I have no experience with perl, but from what I can see, there's nothing in the script preventing extra vowels from being present. Is that true or am I reading it wrong? oops must of missed that this are the words I've found.. idealization idealizations linearization illegalization indefatigation liberalisation liberalization mineralization interlamination internalization liberalizations InterApplication deliberalization demineralization interapplication semihepatization sentimentalization trade-liberalization the dictionary was taken from here : ftp://ftp.ox.ac.uk/pub/wordlists/american/ this is the code I used.. in case anyone cares.. #!C:\strawberry\perl\bin #i read the dir , because it contained more than one file opendir DIR,"dex"; while ($line =readdir(DIR)){ if ($line ne /.+/){ push @array,$line; #I remember all file names in @array } } #i remove first two values of the array which are "." and ".." shift(@array); shift(@array); open TOTAL ,">dex.txt"; #checking everyfile.. foreach $val (@array){ open F,"<","dex/".$val; while ($line=<F>){ if ($line =~ /[bcdfghjklmnpqrstxyz]*i[bcdfghjklmnpqrstxyz]*e[bcdfghjklmnpqrstxyz]*a[bcdfghjklmnpqrstxyz]*i[bcdfghjklmnpqrstxyz]*a[bcdfghjklmnpqrstxyz]*i[bcdfghjklmnpqrstxyz]*o[bcdfghjklmnpqrstxyz]*/i){ print TOTAL $line,"\n"; } } close F; } awesome! Thanks! However: deliberalization demineralization semihepatization sentimentalization trade-liberalization Do not qualify Quote Link to comment https://forums.phpfreaks.com/topic/161713-odd-request-checking-a-dictionary-filedatabase-for-words-meeting-criteria/#findComment-853920 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.