How to use the duden.main.get function in duden

To help you get started, we’ve selected a few duden examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github radomirbosak / duden / tests / test_duden.py View on Github external
def setUpClass(cls):
        """
        Load json data used for testing
        """
        cls.samples = []

        for filename in os.listdir(JSON_DIR):
            full_path = os.path.join(JSON_DIR, filename)
            if filename.endswith('.json'):
                with open(full_path, 'r') as fh:
                    word_json = json.load(fh)
                    word_obj = duden.get(word_json['urlname'])

                    cls.samples.append((word_json, word_obj))
github radomirbosak / duden / tests / test_duden.py View on Github external
def test_get(self):
        """
        Test if the word laufen can be parsed
        """
        word = 'laufen'
        dword = duden.get('laufen')
        self.assertEqual(word, dword.title)