Giter VIP home page Giter VIP logo

tab2opf's Introduction

tab2opf

Remake of tab2opf dictionary builder for kindle

Script to convert tab delimited dictionary files into opf file to run with kindlegen into a translation lookup dictionary for kindle.

Based on the generally available tab2opf.py by Klokan Petr Přidal (www.klokan.cz) from 2007

The script has been mostly rewritten and extended. The encoding convolutions have been removed, and the code migrated to python3

The input form is: Word(s) \t Definition

By running tab2opf.py path/file.txt in the current directory file.opf and file*.html are created which can then be converted with kindlegen file.opf into file.mobi

--source and --target options define which language to which we are translating.

tab2opf has a -m option to load a module to load getkey and getdef functions and mapping dictionary from that namespace into the current one; if it doesn't find such defined member(s), no error is produced.

getkey converts the term (the Word(s)) into a search key. getdef converts Definition in some arbitrary way. mapping is a dictionary mapping from char -> char to replace some set of characters in the input with characters in the output.

Used and tested is the dictcc.py, which converts a dict.cc german -> english dictionary (http://www.dict.cc/?s=about%3Awordlist&l=e). The keys are the longest word in the Word(s) after removal of prepositional phrases and some pronouns (in getkey). The definitions remap the dict.cc pattern of "definition \t part-of-speech" into (part-of-speech) definiton.

tab2opf's People

Contributors

apeyser avatar weirdsoul avatar

Watchers

James Cloos 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.