We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d644ad9 commit 1d7b9edCopy full SHA for 1d7b9ed
1 file changed
itn/english/rules/word.py
@@ -12,7 +12,7 @@
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
15
-from pynini import accep, closure
+from pynini import difference, union
16
from pynini.lib.pynutil import insert
17
18
from tn.processor import Processor
@@ -26,8 +26,6 @@ def __init__(self):
26
self.build_verbalizer()
27
28
def build_tagger(self):
29
- apostrophe = accep("'") | accep("’")
30
- word = self.ALPHA.plus + closure(apostrophe + self.ALPHA.plus, 0, 1)
31
- word |= self.ALPHA.plus + accep("!")
32
- tagger = insert('value: "') + word + insert('"')
+ valid_char = difference(self.NOT_SPACE, union('"', "\\"))
+ tagger = insert('value: "') + valid_char.plus + insert('"')
33
self.tagger = self.add_tokens(tagger)
0 commit comments