How to use the duden.common.clear_text 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 / duden / search.py View on Github external
def get_search_link_variants(link_text):
    """
    Lists possible interpretations of link text on search page.

    Used for determining whether a search page entry matches the search term.
    """
    return clear_text(link_text).split(', ')
github radomirbosak / duden / duden / word.py View on Github external
('Läufchen', 'Laeufchen'),
              ('Läufel', 'Laeufel')],
             'Im Alphabet danach': [('laufend', 'laufend'),
              ('laufen lassen, laufenlassen', 'laufen_lassen'),
              ('Laufer', 'Laufer'),
              ('Läufer', 'Laeufer'),
              ('Lauferei', 'Lauferei')]}
        """
        result = {}
        section = self.soup.find('div', id='block-beforeafterblock-2')
        for group in section.find_all('nav', class_='hookup__group'):
            h3title = group.h3.text
            result[h3title] = []
            for item in group.find_all('li'):
                link = item.a.attrs['href'].split('/')[-1]
                result[h3title].append((clear_text(item.text), link))
        return result