Giter Site home page Giter Site logo

wikisill's Introduction

Sillabazione dal Wikizionario

Semplice tool in Python3 che estrae dal Wikizionario la sillabazione dei lemmi italiani (NB funziona offline usando il dump xml del sito).

Funzionamento

  1. scaricare il dump del database di it_wiktionary da https://dumps.wikimedia.org/backup-index.html
  2. scompattare l'archivio nella stessa cartella del programma
  3. avviare lo script

In un terminale Linux la sequenza di comandi è:

wget https://dumps.wikimedia.org/itwiktionary/latest/itwiktionary-latest-pages-meta-current.xml.bz2
bzip2 -f -d itwiktionary-latest-pages-meta-current.xml.bz2
python3 wiktionaryit2hyph.py

Opzioni avanzate

E possibile utilizzare le opzioni a linea di comando:

  • -f NOMEFILEDUMP per indicare un diverso file xml (default itwiktionary-latest-pages-meta-current.xml)
  • -a per mostrare gli accenti tonici nella sillabazione
  • -l per mostrare in output il link alla pagina del lemma nel wikizionario
  • -s per inserire i risultati su db sqlite3 invece che stamparli a schermo
  • -d per indicare un diverso nome file per il db sqlite3 (default wiki.sqlite3)
  • -t per indicare una diversa tabella nel db (default itwiktionary)

Utilizzi non convenzionali

Per avere un rapido dizionario lemma-sillabazione su file lanciare

python3 wiktionaryit2hyph.py | sort > silldiz.txt

Per avere un elenco di pagine errate con sillabazione incongruente (ovvero dove le sillabe ricomposte non corrispondono al lemma di partenza)

python3 wiktionaryit2hyph.py | sort | sed 's/-//g' | awk 'BEGIN{FS=",";OFS=","} tolower($1)!=$2 {print $1,$2,$3}'

wikisill's People

Contributors

emanueleg avatar

Watchers

 avatar  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.