Giter Site home page Giter Site logo

global-lemmatizer's Introduction

GLOBAL-LEMMATIZER

This script aims to parse all "derivative of" templates in the English Wiktionary and link the forms to their lemmas.

Usage

  • Download the Wiktionary pages/articles XML dump in the project root.
  • Edit the filename in context = etree.iterparse('enwiktionary-20240120-pages-articles.xml', tag='{http://www.mediawiki.org/xml/export-0.10/}page') to match the filename.
  • Run the python script.
  • Once the script is done running, open forms.db and you can do stuff like:
sqlite> SELECT lemma, language FROM word_forms WHERE form = 'programo'; 
programar|Catalan
programar|Spanish
programar|Portuguese
sqlite> SELECT form FROM word_forms WHERE lemma = 'programar' AND language = 'Spanish';       
programo
programa
programando
programado
programad
programas
programamos
programáis
programan
programaba
programabas
programábamos
programabais
programaban
[...]

Limitations

  • Entries with wikitext used as the lemma form will register the wikitext value as the lemma.
sqlite> select lemma, language from word_forms where form = 'SQL'; 
w:Structured Query Language|English
  • Form type doesn't take template aliases into consideration.
sqlite> select lemma, type, language from word_forms where form = 'MK';  
Milton Keynes|init of|English
Mong Kok|init of|English
[[member|Member]] of [[Knesset]]|initialism of|English
[[missionary]]'s [[kid]]|initialism of|English
mahkamah konstitusi|initialism of|Indonesian
mata kuliah|initialism of|Indonesian
mooseknuckle|initialism of|English
{{w|lang=en|Mario Kart}}|init of|English
{{w|lang=en|Mortal Kombat}}|init of|English
  • See TODO comments.

global-lemmatizer's People

Contributors

heartade avatar

Stargazers

Trenton Moore avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.