Giter Site home page Giter Site logo

burhanharoon / urdu-stemmer Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 13 KB

A simple python based Urdu stemmer which tries to find a stem word from a list of affixes.

Python 100.00%
urdu-nlp urdu-language urdu urdu-text-processsing python python3 stemming stemming-algorithm

urdu-stemmer's Introduction

Urdu Stemmer

It is a python based urdu stemmer. From a given list of words, it will try to find their stems using a limited list of affixes given in the program.

stemmer.py: This file contains the logic and implementation of the stemmer. It uses regular expressions to find prefixes at the start of a word and suffixes at the end of the word.

Following are the list of (currently present) affixes:

urduPrefixes = ['بے', 'بد', 'لا', 'ے', 'نا', 'با', 'کم', 'ان', 'اہل', 'کم']
urduSuffixes = ['دار', 'وں', 'یاں', 'یں', 'ات', 'گوار', 'ور', 'پسند']

To find a prefix it uses this regular expresseion:

checkPrefix = re.search(rf'\A{prefix}', urduWord)

To find a suffix it uses this regular expression:

checkSuffix = re.search(rf"{suffix}\Z", urduWord)

urdu-affixes.txt: This file contains the input words for the stemmer.py. It contains two colloums and are read from urdu way of reading files (right to left).

words

  • The words on the most right act as a input for the program. The stemmer reads them and finds their stems.
  • The words on the most left are the actual stem words of words on the right side. These are wriiten manuually to calcaulate the efficency/accuracy of the program i.e. How many stem words the program calculated right?

urdu-stemmer's People

Contributors

burhanharoon avatar

Stargazers

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