Jump to content

Odd request... checking a dictionary file/database for words meeting criteria


DaveLinger

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :P

 

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;
}

Link to comment
Share on other sites

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 :P

 

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.