ShowMeHowItWorks.st
changeset 3821 798167a7637b
parent 3820 2c48933f35cb
child 3825 0c6e23229b42
equal deleted inserted replaced
3820:2c48933f35cb 3821:798167a7637b
   517         self talking ifTrue:[
   517         self talking ifTrue:[
   518             talkDone := Semaphore new.
   518             talkDone := Semaphore new.
   519             [
   519             [
   520                 |sentence|
   520                 |sentence|
   521                 sentence := (sentenceOrNil ? xLatedMessage) copy withCRs replaceAny:c'\t' with:(Character space).
   521                 sentence := (sentenceOrNil ? xLatedMessage) copy withCRs replaceAny:c'\t' with:(Character space).
   522                 sentence := sentence copy withCRs replaceAny:c'\n\r' with:(Character space).
   522                 sentence asStringCollection do:[:eachLineIn |
   523                 sentence := sentence asLowercase.
   523                     |eachLine|
   524                 pronunciations notNil ifTrue:[
   524 
   525                     pronunciations keysAndValuesDo:[:word :pronounced |
   525                     eachLine := eachLineIn.
   526                         (sentence includesString:word) ifTrue:[
   526                     "/ eachLine := eachLine copy withCRs replaceAny:c'\n\r' with:(Character space).
   527                             sentence := sentence copyReplaceString:word withString:pronounced
   527                     eachLine := eachLine asLowercase.
       
   528                     pronunciations notNil ifTrue:[
       
   529                         pronunciations keysAndValuesDo:[:word :pronounced |
       
   530                             (eachLine includesString:word) ifTrue:[
       
   531                                 eachLine := eachLine copyReplaceString:word withString:pronounced
       
   532                             ]
   528                         ]
   533                         ]
   529                     ]
   534                     ].
       
   535                     self tell:eachLine.
   530                 ].
   536                 ].
   531                 self tell:sentence.
       
   532                 talkDone signal
   537                 talkDone signal
   533             ] fork.
   538             ] fork.
   534             
   539             
   535             "/
   540             "/
   536             "/ allow speaker some headoff
   541             "/ allow speaker some headoff
  1555             ].
  1560             ].
  1556             idx notNil ifTrue:[
  1561             idx notNil ifTrue:[
  1557                 self halt.
  1562                 self halt.
  1558             ]
  1563             ]
  1559         ] ifFalse:[
  1564         ] ifFalse:[
  1560             anApplicationOrViewOrMenuItem isMenu ifFalse:[
  1565             (anApplicationOrViewOrMenuItem askFor:#isMenu) ifFalse:[
  1561                 self assert:false message:'container is not a menu'.
  1566                 self assert:false message:'container is not a menu'.
  1562             ].
  1567             ].
  1563             "/ a menu item
  1568             "/ a menu item
  1564             idx notNil ifTrue:[
  1569             idx notNil ifTrue:[
  1565                 item := anApplicationOrViewOrMenuItem itemAtIndex:idx.
  1570                 item := anApplicationOrViewOrMenuItem itemAtIndex:idx.