Example #1
0
 def test_complex_paranthesis(self):
     text = """(נישואין וגירושין) (תיקון – הוראת הרחקה – סמכויות בית-משפט מחוזי), התשנ"ג–1993, לדיון מוקדם, מס' תר"נ."""
     expected = """( נישואין וגירושין ) ( תיקון – הוראת הרחקה – סמכויות בית-משפט מחוזי ) , התשנ"ג–1993 , לדיון מוקדם , מס' תר"נ ."""
     result = transform_paragraphs("Monkey", [text])
     self.assertEqual(expected, result)
Example #2
0
 def test_paranthesis(self):
     text = 'איזה קטע (יש פה "סוגריים") עובד.'
     expected = 'איזה קטע ( יש פה " סוגריים " ) עובד .'
     result = transform_paragraphs("Monkey", [text])
     self.assertEqual(expected, result)
Example #3
0
 def test_paranthesis_with_numbers_and_question(self):
     text = "טובין (תיקון מס' 27) מי נגד"
     expected = "טובין ( תיקון מס' 27 ) מי נגד"
     result = transform_paragraphs("Monkey", [text])
     self.assertEqual(expected, result)
Example #4
0
 def test_quoted_text_tokenization(self):
     text = 'לבנות את ה"פתח-לנד" ולפעול'
     expected = 'לבנות את ה " פתח-לנד " ולפעול'
     result = transform_paragraphs("Monkey", [text])
     self.assertEqual(expected, result)
Example #5
0
    def test_acronym_with_comma(self):
        text = "איזה ז.ב.מ., מלך!"
        expected = "איזה ז.ב.מ. , מלך !"

        result = transform_paragraphs("Monkey", [text])
        self.assertEqual(expected, result)
Example #6
0
    def test_numberz(self):
        text = "1. יש לי 1,000 שטויות בז.ב.ל.."
        expected = "1. יש לי 1,000 שטויות בז.ב.ל. ."

        result = transform_paragraphs("Monkey", [text])
        self.assertEqual(expected, result)
Example #7
0
    def test_numeral_percent(self):
        text = "הפיתוח, 75% מההערכה"
        expected = "הפיתוח , 75% מההערכה"

        result = transform_paragraphs("Monkey", [text])
        self.assertEqual(expected, result)
Example #8
0
 def test_last_sentence_tokenization_issue(self):
     paragraph_text = """כבוד יושב-ראש הכנסת, אדוני שר החינוך, במרכז מדע ודעת למחוננים בשלומי לומדים 351 תלמידים יהודים ודרוזים. במשרד החינוך התקבלה החלטה להעביר את המרכז לכרמיאל, במקום לחזק את שלומי כעיר פיתוח."""
     result = transform_paragraphs("Monkey", [paragraph_text])
     self.assertEqual(3, len(result.split('.')))  # Its stupid :(