Beispiel #1
0
    def __init__(self, deterministic: bool = True):
        super().__init__(name="verbalize",
                         kind="verbalize",
                         deterministic=deterministic)
        cardinal = CardinalFst()
        cardinal_graph = cardinal.fst
        ordinal_graph = OrdinalFst().fst
        decimal = DecimalFst()
        decimal_graph = decimal.fst
        date = DateFst()
        date_graph = date.fst
        measure = MeasureFst()
        measure_graph = measure.fst
        electronic = ElectronicFst()
        electronic_graph = electronic.fst
        whitelist_graph = WhiteListFst().fst
        money_graph = MoneyFst().fst
        telephone_graph = TelephoneFst().fst
        time_graph = TimeFst().fst

        graph = (measure_graph
                 | cardinal_graph
                 | decimal_graph
                 | ordinal_graph
                 | date_graph
                 | electronic_graph
                 | money_graph
                 | whitelist_graph
                 | telephone_graph
                 | time_graph)
        self.fst = graph
Beispiel #2
0
    def __init__(self, deterministic: bool = True):
        super().__init__(name="verbalize",
                         kind="verbalize",
                         deterministic=deterministic)
        whitelist_graph = WhiteListFst(deterministic=deterministic).fst

        self.fst = whitelist_graph
Beispiel #3
0
    def __init__(self, deterministic: bool = True):
        super().__init__(name="verbalize",
                         kind="verbalize",
                         deterministic=deterministic)
        cardinal = CardinalFst(deterministic=deterministic)
        cardinal_graph = cardinal.fst
        decimal = DecimalFst(cardinal=cardinal, deterministic=deterministic)
        decimal_graph = decimal.fst
        ordinal = OrdinalFst(deterministic=deterministic)
        ordinal_graph = ordinal.fst
        fraction = FractionFst(deterministic=deterministic)
        fraction_graph = fraction.fst
        telephone_graph = TelephoneFst(deterministic=deterministic).fst
        electronic_graph = ElectronicFst(deterministic=deterministic).fst
        measure = MeasureFst(decimal=decimal,
                             cardinal=cardinal,
                             fraction=fraction,
                             deterministic=deterministic)
        measure_graph = measure.fst
        time_graph = TimeFst(deterministic=deterministic).fst
        date_graph = DateFst(ordinal=ordinal, deterministic=deterministic).fst
        money_graph = MoneyFst(decimal=decimal,
                               deterministic=deterministic).fst
        whitelist_graph = WhiteListFst(deterministic=deterministic).fst

        graph = (time_graph
                 | date_graph
                 | money_graph
                 | measure_graph
                 | ordinal_graph
                 | decimal_graph
                 | cardinal_graph
                 | telephone_graph
                 | electronic_graph
                 | fraction_graph
                 | whitelist_graph)

        # roman_graph = RomanFst(deterministic=deterministic).fst
        # graph |= roman_graph

        if not deterministic:
            abbreviation_graph = AbbreviationFst(
                deterministic=deterministic).fst
            graph |= abbreviation_graph

        self.fst = graph
Beispiel #4
0
    def __init__(self, deterministic: bool = True):
        super().__init__(name="verbalize", kind="verbalize", deterministic=deterministic)
        cardinal_tagger = CardinalTagger(deterministic=deterministic)
        cardinal = CardinalFst(deterministic=deterministic)
        cardinal_graph = cardinal.fst
        ordinal = OrdinalFst(deterministic=deterministic)
        ordinal_graph = ordinal.fst
        decimal = DecimalFst(deterministic=deterministic)
        decimal_graph = decimal.fst
        fraction = FractionFst(ordinal=ordinal, deterministic=deterministic)
        fraction_graph = fraction.fst
        date = DateFst(ordinal=ordinal)
        date_graph = date.fst
        measure = MeasureFst(cardinal=cardinal, decimal=decimal, fraction=fraction, deterministic=deterministic)
        measure_graph = measure.fst
        electronic = ElectronicFst(deterministic=deterministic)
        electronic_graph = electronic.fst
        whitelist_graph = WhiteListFst(deterministic=deterministic).fst
        money_graph = MoneyFst(decimal=decimal).fst
        telephone_graph = TelephoneFst(deterministic=deterministic).fst
        time_graph = TimeFst(cardinal_tagger=cardinal_tagger, deterministic=deterministic).fst

        graph = (
            cardinal_graph
            | measure_graph
            | decimal_graph
            | ordinal_graph
            | date_graph
            | electronic_graph
            | money_graph
            | fraction_graph
            | whitelist_graph
            | telephone_graph
            | time_graph
        )
        self.fst = graph