コード例 #1
0
ファイル: settings.py プロジェクト: jrwdunham/old-webapp
def getInventoriesAsPropertiesOfC(appSettings):
    """Get Inventory objects for the metalanguage orthography, the narrow and
    broad phonetic transcription inventories, the morphophonemic segmentation
    inventory, the morpheme delimiters, the punctuation set and the
    grammaticalities.  Assign these Inventory objects to c properties.

    """

    # Get metalanguage orthography as an Inventory object
    c.metaLanguageOrthography = h.getCommaDelimitedStringAsInventory(
                            appSettings.metaLanguageOrthography)

    # Get inventories as Inventory object properties of c
    c.narrPhonInventory = h.getCommaDelimitedStringAsInventory(
                                appSettings.narrPhonInventory)
    c.broadPhonInventory = h.getCommaDelimitedStringAsInventory(
                                appSettings.broadPhonInventory)
    c.morphPhonInventory = h.getCommaDelimitedStringAsInventory(
                                appSettings.morphPhonInventory)
    c.morphDelimiters = h.getCommaDelimitedStringAsInventory(
                                appSettings.morphDelimiters)
    c.punctuation = h.Inventory(list(h.removeAllWhiteSpace(
                        appSettings.punctuation)))
    c.grammaticalities = h.getCommaDelimitedStringAsInventory(
                        appSettings.grammaticalities)
コード例 #2
0
ファイル: settings.py プロジェクト: pombredanne/old-webapp
def getInventoriesAsPropertiesOfC(appSettings):
    """Get Inventory objects for the metalanguage orthography, the narrow and
    broad phonetic transcription inventories, the morphophonemic segmentation
    inventory, the morpheme delimiters, the punctuation set and the
    grammaticalities.  Assign these Inventory objects to c properties.

    """

    # Get metalanguage orthography as an Inventory object
    c.metaLanguageOrthography = h.getCommaDelimitedStringAsInventory(
        appSettings.metaLanguageOrthography)

    # Get inventories as Inventory object properties of c
    c.narrPhonInventory = h.getCommaDelimitedStringAsInventory(
        appSettings.narrPhonInventory)
    c.broadPhonInventory = h.getCommaDelimitedStringAsInventory(
        appSettings.broadPhonInventory)
    c.morphPhonInventory = h.getCommaDelimitedStringAsInventory(
        appSettings.morphPhonInventory)
    c.morphDelimiters = h.getCommaDelimitedStringAsInventory(
        appSettings.morphDelimiters)
    c.punctuation = h.Inventory(
        list(h.removeAllWhiteSpace(appSettings.punctuation)))
    c.grammaticalities = h.getCommaDelimitedStringAsInventory(
        appSettings.grammaticalities)
コード例 #3
0
ファイル: settings.py プロジェクト: jrwdunham/old-webapp
        try:
            self.form_result = schema.to_python(dict(request.params), c)
        except Invalid, e:
            return renderEditSettings(
                values=values,
                errors=variabledecode.variable_encode(
                    e.unpack_errors() or {},
                    add_repetitions=False
                )
            )
            return render('/derived/settings/index.html')
        else:
            # Make sure all object language orthographies are mutually
            #  compatible; return the form with a flash message if this is not
            #  the case
            objectLanguageOrthography1 = h.removeAllWhiteSpace(
                self.form_result['objectLanguageOrthography1'])
            OLO1Lowercase = self.form_result['OLO1Lowercase']
            OLO1InitialGlottalStops = self.form_result['OLO1InitialGlottalStops']
            olo1 = h.Orthography(objectLanguageOrthography1,
                                 lowercase=OLO1Lowercase,
                                 initialGlottalStops=OLO1InitialGlottalStops)

            objectLanguageOrthography2 = h.removeAllWhiteSpace(
                self.form_result['objectLanguageOrthography2'])
            OLO2Lowercase = self.form_result['OLO2Lowercase']
            OLO2InitialGlottalStops = self.form_result['OLO2InitialGlottalStops']
            olo2 = h.Orthography(objectLanguageOrthography2,
                                 lowercase=OLO2Lowercase,
                                 initialGlottalStops=OLO2InitialGlottalStops)

            objectLanguageOrthography3 = h.removeAllWhiteSpace(
コード例 #4
0
ファイル: settings.py プロジェクト: pombredanne/old-webapp
        schema = AlterSettingsForm()
        values = dict(request.params)
        try:
            self.form_result = schema.to_python(dict(request.params), c)
        except Invalid, e:
            return renderEditSettings(values=values,
                                      errors=variabledecode.variable_encode(
                                          e.unpack_errors() or {},
                                          add_repetitions=False))
            return render('/derived/settings/index.html')
        else:
            # Make sure all object language orthographies are mutually
            #  compatible; return the form with a flash message if this is not
            #  the case
            objectLanguageOrthography1 = h.removeAllWhiteSpace(
                self.form_result['objectLanguageOrthography1'])
            OLO1Lowercase = self.form_result['OLO1Lowercase']
            OLO1InitialGlottalStops = self.form_result[
                'OLO1InitialGlottalStops']
            olo1 = h.Orthography(objectLanguageOrthography1,
                                 lowercase=OLO1Lowercase,
                                 initialGlottalStops=OLO1InitialGlottalStops)

            objectLanguageOrthography2 = h.removeAllWhiteSpace(
                self.form_result['objectLanguageOrthography2'])
            OLO2Lowercase = self.form_result['OLO2Lowercase']
            OLO2InitialGlottalStops = self.form_result[
                'OLO2InitialGlottalStops']
            olo2 = h.Orthography(objectLanguageOrthography2,
                                 lowercase=OLO2Lowercase,
                                 initialGlottalStops=OLO2InitialGlottalStops)