Code Monkey home page Code Monkey logo

dictionaryactualizer's Introduction

DictionaryActualizer - Python Script

Script to make offline version of dictionary from sjp.pl

Before use!

This script is strict corelated with SjpAPI. I could say: "It is the same", but there are a little difference, so go to repo above and take info before you use this script :)!! This version is very low performance. I dont test how many time is to get meaning from two dictionaries. I will be probably very, very long, about 300mins. A "for"s functions should be parareled.

Thsi script was created to easy get all meaning of word(from txt files) from (Słownik języka polskiego)(www.sjp.pl)

Tables of contents:

  1. Do i need this API?
  2. How it works?
  3. Features
  4. Installation
  5. Using
  6. Examples using
  7. License

.

Do i need this API?

When you need this API:

When you dont need this API:

  • Only need check word is in dictionary or can be used in game like scrabble. In this case you can check any link from there resolve your problem.

.

How it works

It is correlated with SjpAPI but translated to python language

.

Features

  • Make from you dictionary txt file, a dictionary with meaning of word and you will know from which word your word come from:

Example

"kościany" is from word: "kość"

.

Using

The most important paragraph.

For the first you MUST to have: Please check, a format of sjp.txt and psf.txt.

  1. Must be UTF-8
  2. Only first word from line will be processed
  3. If one of the above step will be missed , probably script will fail
  • If you want to fill only dictionary from SJP.PL:
  1. Take your dictionary in txt file, make sure there is in UTF-8 format
  2. Insert this file in "Input folder"
  3. Call script
python3> DictionaryActualizer.py {NAMEOfYourTextFile}.txt
  1. A result will be in Output folder witch name: ""fill-{NAMEOfYourTextFile}.txt
  • If you have a SJP.PL dictionary and OSPS dictonary:
  1. Take your dictionaries in txt file, make sure there is in UTF-8 format
  2. Insert this files in "Input folder"
  3. Call script
python3> DictionaryActualizer.py {NAMEOfYourSJPDict}.txt {NAMEOfYourOSPSDict}.txt
  1. A result willbe in:
  • filled-same.txt ( The same word which was in SJP and OSPS dictonaries )
  • filled-{NAMEOfYourSJPDict}.txt (Word from SJP)
  • filled-{NAMEOfYourOSPSDict}.txt (Word from OSPS)

.

Installation

Just clone this repo and here you are ^^

.

Examples:

Input testowo.txt and Output

If you clone this repo you can run this command:

python3> DictionaryActualizer.py sjp.txt pfs.txt

And after all check Output folder. You will see a examples :D

This is output from examples:

C:\Users\rik13\Desktop\DictionaryActualizer>python DictionaryActualizer.py sjp.txt pfs.txt
Start to process lines:
sjp: 155  lines
pfs: 117  lines

Splitted dictionaries on:
Same in two dictionaries:  68 lines
Unique in sjp dict:  88  lines
Unique in pfs dict:  45  lines

Processing pfsUnique.txt  : ...
Fill  pfsUnique.txt
takes time:  22.43681049346924

Processing same.txt  : ...
Fill  same.txt
takes time:  33.13961362838745

Processing sjpUnique.txt  : ...
Fill  sjpUnique.txt
takes time:  47.09232306480408

C:\Users\rik13\Desktop\DictionaryActualizer>python DictionaryActualizer.py sjp.txt
Start to process lines:  155

Processing sjp.txt  : ...
Fill  sjp.txt
takes time:  81.83865451812744

C:\Users\rik13\Desktop\DictionaryActualizer>

.

License

Apache

dictionaryactualizer's People

Contributors

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