def updateInventoryObjectsInAppGlobals(app_globals, applicationSettings=None): """Updates the narrPhonInvObj, broadPhonInvObj, orthtranscrInvObj, morphBreakInvObj, punctInvObj and morphDelimInvObj properties of app_globals. Called by the applicationSettingsToAppGlobals and X functions. """ if not applicationSettings: applicationSettings = getApplicationSettings() fWNarrPhonTranscrs, fWBroadPhonTranscrs, fWOrthTranscrs, \ fWMorphTranscrs = getForeignWordTranscriptions() storOrthAsList = getStorageOrthographyAsList(applicationSettings) app_globals.punctInvObj = Inventory(app_globals.punctuation) app_globals.morphDelimInvObj = Inventory(app_globals.morphDelimiters) app_globals.narrPhonInvObj = Inventory( fWNarrPhonTranscrs + [u' '] + h.removeAllWhiteSpace(app_globals.narrPhonInventory).split(',')) app_globals.broadPhonInvObj = Inventory( fWBroadPhonTranscrs + [u' '] + h.removeAllWhiteSpace(app_globals.broadPhonInventory).split(',')) app_globals.orthTranscrInvObj = Inventory(fWOrthTranscrs + app_globals.punctuation + [u' '] + storOrthAsList) if app_globals.morphemeBreakIsObjectLanguageString == u'yes': app_globals.morphBreakInvObj = Inventory(fWMorphTranscrs + app_globals.morphDelimiters + [u' '] + storOrthAsList) else: app_globals.morphBreakInvObj = Inventory( fWMorphTranscrs + app_globals.morphDelimiters + [u' '] + h.removeAllWhiteSpace(app_globals.morphPhonInventory).split(','))
def updateInventoryObjectsInAppGlobals(app_globals, applicationSettings=None): """Updates the narrPhonInvObj, broadPhonInvObj, orthtranscrInvObj, morphBreakInvObj, punctInvObj and morphDelimInvObj properties of app_globals. Called by the applicationSettingsToAppGlobals and X functions. """ if not applicationSettings: applicationSettings = getApplicationSettings() fWNarrPhonTranscrs, fWBroadPhonTranscrs, fWOrthTranscrs, \ fWMorphTranscrs = getForeignWordTranscriptions() storOrthAsList = getStorageOrthographyAsList(applicationSettings) app_globals.punctInvObj = Inventory(app_globals.punctuation) app_globals.morphDelimInvObj = Inventory(app_globals.morphDelimiters) app_globals.narrPhonInvObj = Inventory(fWNarrPhonTranscrs + [u' '] + h.removeAllWhiteSpace(app_globals.narrPhonInventory).split(',')) app_globals.broadPhonInvObj = Inventory(fWBroadPhonTranscrs + [u' '] + h.removeAllWhiteSpace(app_globals.broadPhonInventory).split(',')) app_globals.orthTranscrInvObj = Inventory(fWOrthTranscrs + app_globals.punctuation + [u' '] + storOrthAsList) if app_globals.morphemeBreakIsObjectLanguageString == u'yes': app_globals.morphBreakInvObj = Inventory(fWMorphTranscrs + app_globals.morphDelimiters + [u' '] + storOrthAsList) else: app_globals.morphBreakInvObj = Inventory(fWMorphTranscrs + app_globals.morphDelimiters + [u' '] + h.removeAllWhiteSpace(app_globals.morphPhonInventory).split(','))
def getCommaDelimitedStringAsInventory(string): return h.Inventory(h.removeAllWhiteSpace(string).split(','))