From eb72052b380f76e6eef76eb2024d6c65582166a8 Mon Sep 17 00:00:00 2001 From: jcmhk <115221821+jcmhk@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:45:18 +0200 Subject: [PATCH] Update owcorpus.py if language not found continu --- orangecontrib/text/widgets/owcorpus.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/orangecontrib/text/widgets/owcorpus.py b/orangecontrib/text/widgets/owcorpus.py index 6baa1690d..66609350b 100644 --- a/orangecontrib/text/widgets/owcorpus.py +++ b/orangecontrib/text/widgets/owcorpus.py @@ -374,9 +374,13 @@ def describe(features): def migrate_context(cls, context, version): if version < 2: if "language" in context.values: - language, type_ = context.values["language"] - language = LANG2ISO[migrate_language_name(language)] - context.values["language"] = (language, type_) + try: + language, type_ = context.values["language"] + language = LANG2ISO[migrate_language_name(language)] + context.values["language"] = (language, type_) + except Exception as e: + print("unable to load laguage :",e) + return if __name__ == '__main__':