def testArabic1(self):
     text = """
     ويقول ماتياز من الأكاديمية السلوفينية للعلوم والفنون بالعاصمة ليوبليانا، والذي عكف على دراسة هذا النوع من العناكب منذ اكتشافه، إن "طول جسم أنثى عنكبوت لحاء داروين لا يزيد على 1.5 سنتيمتر، أما الوزن فيصل إلى نصف غرام، في حين يكون الذكور أصغر حجما بكثير، إذ تقل أوزانها عن أوزان الإناث بواقع عشر مرات". كما أن أجساد هذه العناكب مموهة، لكي تحاكي شكل لحاء الأشجار، التي تعيش بالقرب منها.
     """.decode("utf-8")
     organization = extract_organization(text)
     self.assertEqual(
         organization,
         """الأكاديمية السلوفينية للعلوم والفنون""".decode("utf-8"))
 def testArabic2(self):
     text = u"\u0644\u062d\u0632\u0628 \u0633\u0648\u0631\u064a\u0627 \u0627\u0644\u0648\u0637\u0646"
     #text = u"\u062d\u0632\u0628 \u0633\u0648\u0631\u064a\u0627 \u0627\u0644\u0648\u0637\u0646"
     organization = extract_organization(text)
     self.assertEqual(
         organization,
         u"\u062d\u0632\u0628 \u0633\u0648\u0631\u064a\u0627 \u0627\u0644\u0648\u0637\u0646"
     )
    def testArabicEndings(self):
        text = u"""
 (\u0627\u0644\u062d\u0631\u0643\u0629 \u0627\u0644\u0648\u0637\u0646\u064a\u0629 \u0627\u0644\u0634\u0639\u0628\u064a\u0629 \u0627\u0644\u0644\u064a\u0628\u064a\u0629\u200e)" src
        """
        organization = extract_organization(text)
        self.assertEqual(
            u"\u0627\u0644\u062d\u0631\u0643\u0629 \u0627\u0644\u0648\u0637\u0646\u064a\u0629 \u0627\u0644\u0634\u0639\u0628\u064a\u0629 \u0627\u0644\u0644\u064a\u0628\u064a\u0629",
            organization)
 def testStartLower(self):
     text = "amount of Cool Party"
     organization = extract_organization(text)
     self.assertEqual("Cool Party", organization)
 def testFlag(self):
     text = "Flag of Pluto Group"
     organization = extract_organization(text)
     self.assertEqual("Pluto Group", organization)
 def testArabicWal(self):
     # translates to army of the thing and the thing
     # we use this to test wal
     text = u"\u062c\u064a\u0634 \u0627\u0644\u0634\u064a\u0621 \u0648\u0627\u0644\u0634\u064a\u0621"
     organization = extract_organization(text)
     self.assertEqual(organization, text)
 def testArabic1(self):
     text = """
     ويقول ماتياز من الأكاديمية السلوفينية للعلوم والفنون بالعاصمة ليوبليانا، والذي عكف على دراسة هذا النوع من العناكب منذ اكتشافه، إن "طول جسم أنثى عنكبوت لحاء داروين لا يزيد على 1.5 سنتيمتر، أما الوزن فيصل إلى نصف غرام، في حين يكون الذكور أصغر حجما بكثير، إذ تقل أوزانها عن أوزان الإناث بواقع عشر مرات". كما أن أجساد هذه العناكب مموهة، لكي تحاكي شكل لحاء الأشجار، التي تعيش بالقرب منها.
     """.decode("utf-8")
     organization = extract_organization(text)
     self.assertEqual(organization, """الأكاديمية السلوفينية للعلوم والفنون""".decode("utf-8"))
 def testOn(self):
     text = u"The Court on Transitional Issues is located somewhere."
     organization = extract_organization(text)
     self.assertEqual("The Court on Transitional Issues", organization)
 def testOn(self):
     text = u"The Court on Transitional Issues is located somewhere."
     organization = extract_organization(text)
     self.assertEqual("The Court on Transitional Issues", organization)
 def testSlash(self):
     text = u"""He was a member of the Non-Aligned Movement."""
     organization = extract_organization(text)
     self.assertEqual("Non-Aligned Movement", organization)
    def testArabicEndings(self):
        text = u"""
 (\u0627\u0644\u062d\u0631\u0643\u0629 \u0627\u0644\u0648\u0637\u0646\u064a\u0629 \u0627\u0644\u0634\u0639\u0628\u064a\u0629 \u0627\u0644\u0644\u064a\u0628\u064a\u0629\u200e)" src
        """
        organization = extract_organization(text)
        self.assertEqual(u"\u0627\u0644\u062d\u0631\u0643\u0629 \u0627\u0644\u0648\u0637\u0646\u064a\u0629 \u0627\u0644\u0634\u0639\u0628\u064a\u0629 \u0627\u0644\u0644\u064a\u0628\u064a\u0629", organization)
 def testStartLower(self):
     text = "amount of Cool Party"
     organization = extract_organization(text)
     self.assertEqual("Cool Party", organization)
 def testFlag(self):
     text = "Flag of Pluto Group"
     organization = extract_organization(text)
     self.assertEqual("Pluto Group", organization)
 def testArabicWal(self):
     # translates to army of the thing and the thing
     # we use this to test wal
     text = u"\u062c\u064a\u0634 \u0627\u0644\u0634\u064a\u0621 \u0648\u0627\u0644\u0634\u064a\u0621"
     organization = extract_organization(text)
     self.assertEqual(organization, text)
 def testArabic2(self):
     text = u"\u0644\u062d\u0632\u0628 \u0633\u0648\u0631\u064a\u0627 \u0627\u0644\u0648\u0637\u0646"
     #text = u"\u062d\u0632\u0628 \u0633\u0648\u0631\u064a\u0627 \u0627\u0644\u0648\u0637\u0646"
     organization = extract_organization(text)
     self.assertEqual(organization, u"\u062d\u0632\u0628 \u0633\u0648\u0631\u064a\u0627 \u0627\u0644\u0648\u0637\u0646")
 def testFor(self):
     text = u"I work for the International Institute for Migration."
     organization = extract_organization(text)
     self.assertEqual("International Institute for Migration", organization)
Beispiel #17
0
 def testSlash(self):
     text = u"""He was a member of the Non-Aligned Movement."""
     organization = extract_organization(text)
     self.assertEqual("Non-Aligned Movement", organization)
Beispiel #18
0
 def test1(self):
     text = "In the year of 2050, he attended the Mars University."
     organization = extract_organization(text)
     self.assertEqual(organization, "Mars University")
Beispiel #19
0
 def testFor(self):
     text = u"I work for the International Institute for Migration."
     organization = extract_organization(text)
     self.assertEqual("International Institute for Migration", organization)
 def test1(self):
     text = "In the year of 2050, he attended the Mars University."
     organization = extract_organization(text)
     self.assertEqual(organization, "Mars University")