Skip to content

Commit

Permalink
Seach with new global/transcription options
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmackie committed May 14, 2018
1 parent d3cf75c commit edb7755
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions slpa/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ class FlexionComboBox(QComboBox):

def __init__(self):
super().__init__()
for symbol in FINGER_SYMBOLS:
for symbol in FINGER_SYMBOLS[:-1]:
#the final description is ignored on this loop and then added afterwards
#because for the search function it's better if we re-order the options
self.addItem(SYMBOL_DESCRIPTIONS[symbol].title())
self.addItem('Extended (any)')
self.addItem('Flexed (any)')
self.addItem('Intermediate (any)')
self.addItem('Unestimatable')#this was the description ignored earlier
self.addItem('Blank')
self.setMaxVisibleItems(len(FINGER_SYMBOLS)+4)

class QuantifierComboBox(QComboBox):

Expand Down Expand Up @@ -232,31 +239,41 @@ def findSlotNumbers(self, finger):
slots = [27, 28, 29]
elif finger == 'pinky':
slots = [32, 33, 34]
elif finger == 'any':
slots = [4, 5, 17, 18, 19, 22, 23, 24, 32, 33, 34]
return slots

def findTranscriptionSymbol(self, description):
if description == 'Unestimatable':
description = description.lower()
if description == 'unestimatable':
symbol = '?'

elif description == 'Blank':
elif description == 'blank':
symbol = ''

elif 'extended' in description:
if 'hyper' in description:
symbol = 'H'
elif 'fully' in description:
symbol = 'E'
else:
elif 'somewhat' in description:
symbol = 'e'
else:
symbol = 'HEe'

elif 'flexed' in description:
if 'fully' in description:
symbol = 'F'
else:
elif 'somewhat' in description:
symbol = 'f'
else:
symbol = 'Ff'

elif 'intermediate' in description:
symbol = 'i'
if 'clearly' in description:
symbol = 'i'
else:
symbol = 'efi'

return symbol

Expand Down

0 comments on commit edb7755

Please sign in to comment.