Skip to content

Commit

Permalink
ru/4.0.dict: Fix typo in panic_max-disjunct-cost
Browse files Browse the repository at this point in the history
  • Loading branch information
ampli committed Jul 26, 2022
1 parent d206480 commit 8d3c186
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions bindings/python-examples/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ def test_open_nonexistent_dictionary(self):

save_stderr = divert_start(2)
self.assertRaises(LG_DictionaryError, Dictionary, dummy_lang + '1')
self.assertIn(dummy_lang + '1', save_stderr.divert_end())
self.assertIn(dummy_lang + '1', str(save_stderr.divert_end()))

save_stderr = divert_start(2)
self.assertRaises(LG_Error, Dictionary, dummy_lang + '2')
self.assertIn(dummy_lang + '2', save_stderr.divert_end())
self.assertIn(dummy_lang + '2', str(save_stderr.divert_end()))

# Check absolute and relative dictionary access.
# Check also that the dictionary language is set correctly.
Expand Down Expand Up @@ -506,7 +506,7 @@ def test_22_defaut_handler_param(self):
dummy_lang = "a dummy dict name (bad param test)"
self.assertRaises(LG_Error, Dictionary, dummy_lang)
LG_Error.printall(self.error_handler_test, self) # grab a valid errinfo
#self.assertIn(dummy_lang, save_stderr.divert_end())
#self.assertIn(dummy_lang, str(save_stderr.divert_end()))
self.assertRaisesRegexp(TypeError, "must be an integer",
self.__class__.handler["default"],
self.errinfo, "bad param")
Expand All @@ -520,7 +520,7 @@ def test_22_defaut_handler_param(self):
self.param_ok = False
save_stdout = divert_start(1) # Note: Handler parameter is stdout
self.__class__.handler["default"](self.errinfo, 1)
self.assertIn(dummy_lang, save_stdout.divert_end())
self.assertIn(dummy_lang, str(save_stdout.divert_end()))
self.param_ok = True
except (TypeError, ValueError):
self.assertTrue(self.param_ok)
Expand Down Expand Up @@ -598,7 +598,7 @@ def test_50_set_orig_error_handler(self):
dummy_lang = "a dummy dict name (default handler test)"
save_stderr = divert_start(2)
self.assertRaises(LG_Error, Dictionary, dummy_lang)
self.assertIn(dummy_lang, save_stderr.divert_end())
self.assertIn(dummy_lang, str(save_stderr.divert_end()))
self.assertEqual(self.errinfo, "dummy")

class FSATsolverTestCase(unittest.TestCase):
Expand Down Expand Up @@ -1283,7 +1283,9 @@ def test_d_morphology(self):

class ZTHLangTestCase(unittest.TestCase):
def test_thai(self):
save_stderr = divert_start(2)
linkage_testfile(self, Dictionary(lang='th'), ParseOptions())
print(save_stderr.divert_end().decode())


class ZXDictDialectTestCase(unittest.TestCase):
Expand Down Expand Up @@ -1501,7 +1503,7 @@ def divert_end(self):
os.close(self.savedfd)
os.unlink(self.filename)
self.filename = None
return str(content)
return content

__del__ = divert_end

Expand Down
2 changes: 1 addition & 1 deletion data/ru/4.0.dict
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define dictionary-version-number 5.11.0;
#define dictionary-locale ru_RU.UTF-8;
#define max-disjunct-cost 2.7;
#define panic_max-disjunct-cost 4.0;
#define panic-max-disjunct-cost 4.0;

<costly-null>: [[[[]]]];

Expand Down

0 comments on commit 8d3c186

Please sign in to comment.