File tree Expand file tree Collapse file tree 2 files changed +1
-26
lines changed
nemo_text_processing/text_normalization/ar/taggers Expand file tree Collapse file tree 2 files changed +1
-26
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ pipeline {
1111 }
1212 environment {
1313
14- AR_TN_CACHE = ' /home/jenkinsci/TestData/text_norm/ci/grammars/10-23-23 -0'
14+ AR_TN_CACHE = ' /home/jenkinsci/TestData/text_norm/ci/grammars/04-24-24 -0'
1515 DE_TN_CACHE = ' /home/jenkinsci/TestData/text_norm/ci/grammars/06-08-23-0'
1616 EN_TN_CACHE = ' /home/jenkinsci/TestData/text_norm/ci/grammars/11-18-23-0'
1717 ES_TN_CACHE = ' /home/jenkinsci/TestData/text_norm/ci/grammars/10-27-23-0'
Original file line number Diff line number Diff line change 1919from nemo_text_processing .text_normalization .ar .utils import get_abs_path
2020
2121
22- def get_quantity (decimal : "pynini.FstLike" , cardinal_up_to_hundred : "pynini.FstLike" ) -> "pynini.FstLike" :
23- """
24- Returns FST that transforms either a cardinal or decimal followed by a quantity into a numeral,
25- e.g. 5 مليون -> integer_part: "خمسة" quantity: "مليون"
26- e.g. 5.4 مليون -> integer_part: "خمسة" fractional_part: "اربعة من عشرة" quantity: "مليون"
27-
28- Args:
29- decimal: decimal FST
30- cardinal_up_to_hundred: cardinal FST
31- """
32- numbers = cardinal_up_to_hundred
33-
34- res = (
35- pynutil .insert ('integer_part: "' )
36- + numbers
37- + pynutil .insert ('"' )
38- + pynini .accep (" " )
39- + pynutil .insert ('quantity: "' )
40- + quantities
41- + pynutil .insert ('"' )
42- )
43- res |= decimal + pynini .accep (" " ) + pynutil .insert ('quantity: "' ) + quantities + pynutil .insert ('"' )
44- return res
45-
46-
4722class DecimalFst (GraphFst ):
4823 """
4924 Finite state transducer for classifying decimal, e.g.
You can’t perform that action at this time.
0 commit comments