Giter Site home page Giter Site logo

mytypo's Introduction

myTypo

myTypo is a python package to simulate typographical errors in Myanmar language.
It was built based on the package "typo" for English Language.

The Myanmar typographic errors are simulated based on the following keyboard. Kb

Usage

import myTypo

myStrError = myTypo.StrError('ကျန်းကျန်းမာမာ ချမ်းချမ်းသာသာ ဘေးရန် ကာစီးသည်', seed=2)
print(myStrError.missing_char().result)
# Should print "ကျ်းကျန်းမာမာ ချမ်းချမ်းသာသာ ဘေးရန် ကာစီးသည်"
print(myStrError.nearby_char().result)
# Should print "ကျ်းကျိ်းမာမာ ချမ်းချမ်းသာသာ ဘေးရန် ကာစီးသည်"

myStrError1 = myTypo.StrError('လူမွဲတွေက မနှေး ခေတ်မီ သူဌေး ဖြစ်တော့မည်', seed=1)
print(myStrError1.nearby_char().result)
# Should print "လူမွဲတွေက ိနှေး ခေတ်မီ သူဌေး ဖြစ်တော့မည်"
print(myStrError1.missing_char().result)
# Should print "လူမွဲတွေက ိှေး ခေတ်မီ သူဌေး ဖြစ်တော့မည်"

Currently, following types of typos can be simulated for text data type:

Given the input sentence "ကျန်းကျန်းမာမာ ချမ်းချမ်းသာသာ ဘေးရန် ကာစီးသည်", different error types produce the following errors.

String typos:

Error type Description Output
char_swap Swaps two random consecutive word characters in the string. ကျန်းကျန်းမာမာ ချမ်းချမ်းသာသာ ဘေးနရ် ကာစီးသည်
missing_char Skips a random word character in the string. ကျ်းကျန်းမာမာ ချမ်းချမ်းသာသာ ဘေးရန် ကာစီးသည်
extra_char Adds an extra, keyboard-neighbor, letter next to a random word character. ကျိန်းကျန်းမာမာ ချမ်းချမ်းသာသာ ဘေးရန် ကာစီးသည်
nearby_char Replaces a random word character with keyboard-neighbor letter. ကျိ်းကျန်းမာမာ ချမ်းချမ်းသာသာ ဘေးရန် ကာစီးသည်
random_space Adds a random space in the string. ကျန ်းကျန်းမာမာ ချမ်းချမ်းသာသာ ဘေးရန် ကာစီးသည်
repeated_char Repeats a random word character. ကျနန်းကျန်းမာမာ ချမ်းချမ်းသာသာ ဘေးရန် ကာစီးသည်

Reference

Todo

  • Update the simulator to simulate spelling errors by using edit distance approach
  • Update the simulator for common spelling errors in both syllable and word levels

mytypo's People

Stargazers

 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.