11'''Vowel evolution program.
22Run with Vowel, Prototype, Game_fns, Agent, Word
33Also import time, random and graphics modules
4- Last update February 2017 HJMS'''
4+ Last update July 2017 HJMS'''
55
66import Vowel , Prototype , time , random , Word , re , Agent , Segment
77from graphics import *
@@ -21,7 +21,7 @@ class Convention:
2121
2222 def __init__ (self , show = False , color_on = True , ls = 50 ):
2323 '''
24- Can be initialized with no arguments.
24+ Can be initialized with no arguments.d
2525 show == True means more output e.g. step reports.
2626 color_on == True means vowels are color-coded,
2727 where the colors are static according to master set (IPA symbol names).
@@ -51,7 +51,7 @@ def __init__(self, show = False, color_on = True, ls = 50):
5151 self .param_str = "" #center label
5252 self .set_vowels () #creates ipa_dict "master set"
5353 self .plot = self .plot_spots #plot_symbols will use symbols instead
54-
54+ self . func_load_max = 5
5555
5656
5757 def __str__ (self ):
@@ -337,26 +337,26 @@ def set_vowels(self):
337337 #BACK
338338 new_pro ( p_hz (331 , 999 , 150 , "turned_m" ) ) #unrounded [turned_m]
339339 new_pro ( p_hz (331 , 999 , 250 , "turned_m:" ) ) #unrounded [turned_m:]
340- new_pro ( p_hz (331 , 800 , 150 , "u" ) ) #rounded [u]
341- new_pro ( p_hz (331 , 800 , 250 , "u:" ) ) #rounded [u:]
340+ new_pro ( p_hz (331 , 850 , 150 , "u" ) ) #rounded [u]
341+ new_pro ( p_hz (331 , 850 , 250 , "u:" ) ) #rounded [u:]
342342
343343 new_pro ( p_hz (405 , 1150 , 150 , "horseshoe" ) ) #singleton [omega]
344344 new_pro ( p_hz (405 , 1150 , 250 , "horseshoe:" ) ) #singleton [omega:]
345345
346346 new_pro ( p_hz (465 , 1000 , 150 , "rams_horn" ) ) #unrounded [rams_horn]
347347 new_pro ( p_hz (465 , 1000 , 250 , "rams_horn:" ) ) #unrounded [rams_horn:]
348- new_pro ( p_hz (465 , 800 , 150 , "o" ) ) # rounded [o]
349- new_pro ( p_hz (465 , 800 , 250 , "o:" ) ) # rounded [o:]
348+ new_pro ( p_hz (465 , 850 , 150 , "o" ) ) # rounded [o]
349+ new_pro ( p_hz (465 , 850 , 250 , "o:" ) ) # rounded [o:]
350350
351351 new_pro ( p_hz (600 , 1000 , 150 , "wedge" ) ) #unrounded [wedge] aka ^
352352 new_pro ( p_hz (600 , 1000 , 250 , "wedge:" ) ) #unrounded [wedge:] aka ^
353- new_pro ( p_hz (600 , 800 , 150 , "open_o" ) ) #rounded [open_o]
354- new_pro ( p_hz (600 , 800 , 250 , "open_o:" ) ) #rounded [open_o:]
353+ new_pro ( p_hz (600 , 850 , 150 , "open_o" ) ) #rounded [open_o]
354+ new_pro ( p_hz (600 , 850 , 250 , "open_o:" ) ) #rounded [open_o:]
355355
356356 new_pro ( p_hz (734 , 1020 , 150 , "script_a" ) ) #unrounded [script_a]
357357 new_pro ( p_hz (734 , 1020 , 250 , "script_a:" ) ) #unrounded [script_a:]
358- new_pro ( p_hz (734 , 800 , 150 , "rev_script_a" ) ) #rounded [rev_script_a]
359- new_pro ( p_hz (734 , 800 , 250 , "rev_script_a:" ) ) #rounded [rev_script_a:]
358+ new_pro ( p_hz (734 , 850 , 150 , "rev_script_a" ) ) #rounded [rev_script_a]
359+ new_pro ( p_hz (734 , 850 , 250 , "rev_script_a:" ) ) #rounded [rev_script_a:]
360360
361361
362362 ############Add new prototypes above this line##############
@@ -446,7 +446,7 @@ def rand_lexicon(self):
446446 #proto balance (functional load)
447447 #should probably seed instead of generating inside the loop.
448448 #ex. ratio_lim = 5 means any proto can have up to 5x as many words as another proto
449- ratio_lim = 5 # (min_words_vowel) <= number of words in class <= (min_words_vowel * ratio lim)
449+ ratio_lim = self . func_load_max # (min_words_vowel) <= number of words in class <= (min_words_vowel * ratio lim)
450450
451451 for nucleus in p_list :
452452 num_words_vowel = r .randint (min_words_vowel , min_words_vowel * ratio_lim )
@@ -750,7 +750,7 @@ def plot_spots(self, pause = 0, mc = 1, s = None):
750750
751751 #update the printout of prototypes
752752 if self .color_on :
753- w = self .chart_w + (self .win_margin * 2 )+ 125
753+ w = self .chart_w + (self .win_margin * 2 )+ 145
754754 message1 = self .side_label ("Convention Vowels" , w , h_side )
755755 message2 = self .label (self .param_str , h )
756756
@@ -857,7 +857,7 @@ def plot_symbols(self, pause = 0, mc = 1, s = None):
857857
858858 #update the printout of prototypes
859859 if self .color_on :
860- w = self .chart_w + (self .win_margin * 2 )+ 125
860+ w = self .chart_w + (self .win_margin * 2 )+ 145
861861 message1 = self .side_label ("Convention Vowels" , w , h_side )
862862 message2 = self .label (self .param_str , h )
863863
@@ -912,12 +912,12 @@ def plot_symbols(self, pause = 0, mc = 1, s = None):
912912 symb = ipa_trans [p_class ] #proto's name (may be unicode)
913913
914914 #black outlines of the symbols
915- proto_symb_stroke = self .get_symbol_obj (symb , tp , 20 , 'gray4' , 'bold' )
915+ proto_symb_stroke = self .get_symbol_obj (symb , tp , 30 , 'gray4' , 'bold' )
916916 proto_symb_stroke .draw (win )
917917 curr_proto_pts .append (proto_symb_stroke ) #store so we can undraw later
918918
919919 if self .color_on :
920- proto_symb = self .get_symbol_obj (symb , tp , 20 , color )
920+ proto_symb = self .get_symbol_obj (symb , tp , 30 , color )
921921 proto_symb .draw (win )
922922 curr_proto_pts .append (proto_symb )
923923
@@ -1269,7 +1269,7 @@ def set_formant_limits(self):
12691269 #second formant (x axis)
12701270
12711271 self .e2_closed_max = 24.5
1272- self .e2_min = 12.25
1272+ self .e2_min = 11.75
12731273 e2_range = self .e2_closed_max - self .e2_min
12741274 self .e2_open_max = self .e2_closed_max - (e2_range / 8 )
12751275
@@ -1281,7 +1281,7 @@ def set_formant_limits(self):
12811281 #if using color coding, make the window bigger
12821282 co = self .color_on
12831283 if co :
1284- self .win_width = 1025
1284+ self .win_width = 1100
12851285 self .win_height = 650
12861286 self .win_margin = 40
12871287 self .chart_w = 800 - (self .win_margin * 4 )
@@ -1310,7 +1310,7 @@ def draw_color_map(self, ipa = False):
13101310 h = self .win_margin
13111311 h2 = h #+ 15
13121312
1313- w = self .chart_w + (self .win_margin * 2 )+ 62
1313+ w = self .chart_w + (self .win_margin * 2 )+ 100
13141314
13151315 #check to see if side label has been drawn already
13161316 if not self .proto_label :
@@ -1346,7 +1346,7 @@ def draw_color_map(self, ipa = False):
13461346 ps = ipa_trans [protos [i ]]
13471347 else :
13481348 ps = p1
1349- message2 = self .side_label (ps , w + 57 , h2 )
1349+ message2 = self .side_label (ps , w + 70 , h2 )
13501350
13511351 message2 .draw (win )
13521352 circle = Circle (Point (w , h2 ), 6.5 )
@@ -1369,7 +1369,7 @@ def draw_color_map(self, ipa = False):
13691369 ps2 = p2
13701370 w2 = w + 155
13711371 p_color = self .color_map [p2 ]
1372- message2 = self .side_label (ps2 , w2 + 57 , h2 )
1372+ message2 = self .side_label (ps2 , w2 + 57 , h2 )#proto names
13731373 message2 .draw (win )
13741374 circle = Circle (Point (w2 , h2 ), 6.5 )
13751375 circle .setFill (p_color )
@@ -1388,7 +1388,7 @@ def draw_color_map(self, ipa = False):
13881388 ps = ipa_trans [p1 ]
13891389 else :
13901390 ps = p1
1391- message2 = self .side_label (ps , w + 57 , h2 )
1391+ message2 = self .side_label (ps , w + 57 , h2 ) #proto names
13921392 message2 .draw (win )
13931393 circle = Circle (Point (w , h2 ), 7 )
13941394 circle .setFill (p_color )
0 commit comments