4Likes -
consonant clusters
how can i classify consonat clusters
-
Re: consonant clusters

Originally Posted by
andre1979
how can i classify consonat clusters
How do you want to classify them?
-
Re: consonant clusters
I am not sure exactly what you mean by 'classifying' them.
Perhaps you could try grouping them into clusters of three consonants: /glImps/ and four: /glImpst/
Or by voiced-unvoiced-unvoiced: /glɑːnst/ and unvoiced-unvoiced-unvoiced: /nekst/
Or by how consonant clusters may be put together in English, as in: CVC (bed), CCVC (bled), CCVCC (blend), etc.
-
Re: consonant clusters
Here's a little python program. It works, but python can also be easily read as an algorithm too. It finds as many consonant clusters as are in you wordlist, and prints them in alphabetical order.
If you want to classify them some other way (apart from alphabetically), you'd need to add a few lines.
If you want to classify consonant sounds, you need a different program with 'phl' represented as 'fl', for example, and a phonetic dictionary stripped of extraneous marks. (Maybe that will be my next project).
---------------------------------------------
# findClusters.py
# Raymott 24/10/2010
# Finds 2-letter consonant custers in a dictionary and sorts them. Extendable to 3, 4 +
clist = [] #start with empty list of clusters
cluster = "" # empty cluster
letters = "bcdfghjklmnpqrstvwxz" #consonants
dictionary = "a temporary dictionary - replace" #Replace this string with a very big word list
# Get 2-letter clusters
for first in letters:
oooofor second in letters:
oooooooocluster = first + second
ooooooooif cluster in dictionary:
ooooooooooooif cluster not in clist:
ooooooooooooooooclist.append(cluster)
clist.sort() # Can sort list in a few ways
print clist # prints [‘ct’, ‘mp’, ‘pl’] with above string as dictionary.
-
Re: consonant clusters
Thanks. I'll try to use that some time. Trouble is, I'm nearly computer illiterate, and if something can go wrong, it will.
By the way, is custers in the third line of your program a typo in the program which should therefore be retained, or a typo in this message, which should therefore be corrected. Or is it something else?
-
Re: consonant clusters

Originally Posted by
fivejedjon
Thanks. I'll try to use that some time. Trouble is, I'm nearly computer illiterate, and if something can go wrong, it will.
By the way, is custers in the third line of your program a typo in the program which should therefore be retained, or a typo in this message, which should therefore be corrected. Or is it something else?
Sorry, it's a typo, but it's in a 'comment', which the complier doesn't read. All comments (in python anything following # on a line) are stripped off the program before the compiler reads it; so it isn't important.
I've tried the program with 3, 4 and 5-letter clusters, but you need to go off and get coffee while it's working on the 5-letter ones.
I'm working on a version which, instead of ignoring duplicates, actually counts the instances. One could then classify (or list) them by frequency of occurrence.
-
Re: consonant clusters
How do you do 3/4/5 letters? Clist + letters?
-
Re: consonant clusters

Originally Posted by
Tdol
How do you do 3/4/5 letters? Clist + letters?
The simplest way, in keeping with my poor level of programming, would be to add functions one after the other, and have them run consecutively, then join the lists.
-----------------------
#Get 2-letter clusters
for first in letters:
oooofor second in letters:
oooooooocluster = first + second
...
clist.sort()
...
#Get 3-letter clusters
dlist = []
for first in letters:
oooofor second in letters:
oooooooofor third in letters:
oooooooooooocluster = first + second + third
...
dlist.sort()
clist.append(dlist)
#Get 4-letter clusters
elist = []
...
clist.append(elist)
---------------
The more involved way would be to write one function that increments the number of consonants to look for. There would be a number of ways of doing this, none of which I've worked out yet.
for clusterSize = 2 .. 6:
...
---------------------------------------
#Third method - looks for bc, then bcd, then bcdf ... before looking for bd
for first in letters:
oooofor second in letters:
oooooooocluster = first + second
...
clist.sort()
... #Get 3-letter
oooooooofor cluster in letters:
oooooooooooofor third in letters:
oooooooooooooooocluster = cluster + third
ooooclist.append(dlist.sort())
...#Get 4-letter
:=
-
Re: consonant clusters
I know nothing about python, but if it searched for vowels and excluded rather than appending, might that not give it less to search through?
-
Re: consonant clusters

Originally Posted by
Tdol
I know nothing about python, but if it searched for vowels and excluded rather than appending, might that not give it less to search through?
But you're looking for consonant clusters.
If the text was "banana", and you excluded the vowels, you'd have 'bnn', but that's not a cluster in 'banana', which doesn't have a consonant cluster. You'd also have to exclude consonants that were surrounded by vowels.
I guess you could swap all vowels with a space on the first pass, then swap all single consonants with a space on the second, and you'd be left with consonant clusters.
Something like this:
Change vowels to spaces"
for x in "aeiou"
....for x in dictionary
........x = ' '
Then change isolated consonants to spaces
for x in "bcdfghjklmnpqrstvxwxz"
....for " x " in dictionary
........" x " = " "
Then gather up the clusters
for word in dictionary
....list.append(word.stripSpaces())
list.sort()
One possible drawback is the work necessary for swapping letters to spaces is greater than that needed for merely searching and passing over them. Of course, there are always other possible ways to do things. Last night I just dashed off the most obvious way I could think of, regardless of good Software Engineering principles
Yours is a good idea though. I'll try it sometime.
PS: You'd also have to strip off all punctuation marks, perhaps newline and tab marks, etc. Also, this method is destructive, so you'd need to do it on a copy of the dictionary! There's a lot to consider!
Last edited by Raymott; 25-Oct-2010 at 16:42.
Similar Threads
-
By pato389 in forum Ask a Teacher
Replies: 3
Last Post: 25-Nov-2008, 11:39
-
By user_gary in forum Ask a Teacher
Replies: 1
Last Post: 22-Oct-2008, 11:58
-
By playagain in forum Ask a Teacher
Replies: 2
Last Post: 01-Feb-2008, 04:51
-
By Fazzu in forum Ask a Teacher
Replies: 3
Last Post: 19-Jun-2006, 05:42
-
By j4mes_bond25 in forum Pronunciation and Phonetics
Replies: 3
Last Post: 18-Jun-2006, 08:17
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Search Engine Optimization by
vBSEO 3.6.1