Git Product home page Git Product logo

wergor's Introduction

Wergor transliterator

Transliteration system for Kurdish

Since 2020, this project is now part of the Kurdish Language Processing Toolkit (KLPT): [https://github.com/sinaahmadi/klpt].

Wergor is a transliteration system for Sorani Kurdish Latin-based and Arabic-based orthographies. In this first version, we have used a rule-based method. It is the result of a research project published in the ACM Transactions on Asian and Low-Resource Language Information Processing (TALLIP) and can be downloaded here: https://dl.acm.org/citation.cfm?id=3278623

Usage

The script can be used in command-line or directly by importing the Wergor class in your codes.

Command-line usage

python Wergor.py -<mode> <input file>.txt

Currently -arabic2latin and -latin2arabic are the only defined modes. The input file should be in .txt format. By running the script, the output file is automatically created in the same directory with "_transliterated" added to the name of the input file.

Importing Wergor class in the Wergor module

import Wergor
# Arabic to Latin transliteration
wergor_transliterator = Wergor.Wergor("-arabic2latin")
print wergor_transliterator._transliterate(u"هەڵاوێر")

# Latin to Arabic transliteration
wergor_transliterator = Wergor.Wergor("-latin2arabic")
print wergor_transliterator._transliterate(u"birayetî")

# Syllable detection based on the defined patterns (not complete)
wergor_transliterator = Wergor.Wergor("-latin2arabic")
print wergor_transliterator._syllable_detector(u"henase")

This script yields the folowing outputs:

heławêr
برایەتی
[('CV', 'CV', 'CV'), ('CV', 'CVC', 'V'), ('CVC', 'V', 'CV'), ('CVC', 'VC', 'V')]

Presently the Wergor transliterator only supports UTF-8 encoding. If not interested in getting red lines in your console make sure to encode your strings in UTF-8 or simply add u to the beginning of your strings (i.e., word1 = u"جوان").

For each orthography, two text files are provided in the examples folder that you can test. Note that _syllable_detector() which suggests the possible syllable structures in a given word is not an option for the command-line usage.

Wergor corpus

If you are interested in the task of transliteration or you are going to study the existing challenges in the Sorani Kurdish text processing more in depth, Wergor corpus can help you. Wergor corpus includes 20k manually transliterated Sorani Kurdish words in the Arabic-based and the Latin-based orthographies.

If you're using a character-level model, you may use transliteration_data_set.pickle in the dataset folder. This file contains the preprocessed tokens in the corpus. By unpickling this file, you have a list of tuples containing a token with its transliteration. Our tokenization is based on the space delimiter.

Requirements

  • KurdITGroup keyboard (Download).
  • Python 2.7

Reference

If you're using Wergor transliterator in your researches, please don't forget to cite the following paper.

@article{ahmadi2019rule,
  title={A Rule-Based Kurdish Text Transliteration System},
  author={Ahmadi, Sina},
  journal={ACM Transactions on Asian and Low-Resource Language Information Processing (TALLIP)},
  volume={18},
  number={2},
  pages={18},
  year={2019},
  publisher={ACM}
}

This helps us to also find your work easily.

License

MIT License

Copyright (c) 2017 Sina Ahmadi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contact

If you have any questions, suggestions or bug reports, you can contact me at sina.ahmadi at etu.parisdescartes.fr.

wergor's People

Contributors

sinaahmadi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

venkataprabhav

wergor's Issues

recreate this in JS

thank you for your contribution to kurdish language this repository would be very useful if you could recreate it using JS(javascript) i personally would use it everywhere in my projects to generate article and post slugs using titles, some tools exist for transliteration but not specific to Kurdish language most of the cases you should customize them and pass the mappings manually.

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.