Giter VIP home page Giter VIP logo

tagalogstemmerpython's Introduction

Tagalog Words Stemmer using Python

By: Carl Jerwin F. Gensaya, PUP 4th Year ComSci Student

Description:

Tagalog Words Stemmer is a program that processes Tagalog words by removing all of its affixes and returns the root of the words.

Sample Output:

Input: "Patuloy pa din sila sa paghahanap ng posibleng gamot sa malubhang sakit ng dinaramdam ng kanyang ina."

word : root
  • patuloy : tuloy
  • pa : pa
  • din : din
  • sila : sila
  • sa : sa
  • paghahanap : hanap
  • ng : ng
  • posibleng : posible
  • gamot : gamot
  • sa : sa
  • malubhang : lubha
  • sakit : sakit
  • ng : ng
  • dinaramdam : daramdam
  • ng : ng
  • kanyang : kanya
  • ina. : ina
word_info
  • {'prefix': ['pa'], 'clean': [], 'infix': [], 'root': 'tuloy', 'repeat': [], 'suffix': [], 'word': 'Patuloy', 'dupli': []}
  • {'prefix': '[]', 'clean': '[]', 'infix': '[]', 'root': 'pa', 'repeat': '[]', 'suffix': '[]', 'word': 'pa', 'dupli': '[]'}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'din', 'repeat': [], 'suffix': [], 'word': 'din', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'sila', 'repeat': [], 'suffix': [], 'word': 'sila', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'sa', 'repeat': [], 'suffix': [], 'word': 'sa', 'dupli': []}
  • {'prefix': ['pag'], 'clean': [], 'infix': [], 'root': 'hanap', 'repeat': ['ha'], 'suffix': [], 'word': 'paghahanap', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'ng', 'repeat': [], 'suffix': [], 'word': 'ng', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'posible', 'repeat': [], 'suffix': ['ng'], 'word': 'posibleng', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'gamot', 'repeat': [], 'suffix': [], 'word': 'gamot', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'sa', 'repeat': [], 'suffix': [], 'word': 'sa', 'dupli': []}
  • {'prefix': ['ma'], 'clean': [], 'infix': [], 'root': 'lubha', 'repeat': [], 'suffix': ['ng'], 'word': 'malubhang', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'sakit', 'repeat': [], 'suffix': [], 'word': 'sakit', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'ng', 'repeat': [], 'suffix': [], 'word': 'ng', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': ['in'], 'root': 'daramdam', 'repeat': [], 'suffix': [], 'word': 'dinaramdam', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'ng', 'repeat': [], 'suffix': [], 'word': 'ng', 'dupli': []}
  • {'prefix': [], 'clean': [], 'infix': [], 'root': 'kanya', 'repeat': [], 'suffix': ['ng'], 'word': 'kanyang', 'dupli': []}
  • {'prefix': [], 'clean': ['.'], 'infix': [], 'root': 'ina', 'repeat': [], 'suffix': [], 'word': 'ina.', 'dupli': []}
validation
  • Accuracy: 94.12%
  • Errors: ['daramdam']

Usage:

python TglStemmer.py [mode] [source] [info]

  • modes: [1: text_file] [2: raw_string]
  • source: [1: file_name] [2: "raw_string"]
  • info: [1 word-root] [2: show_word_info]

Fix List:

  • mag-aa
  • mag-alinlangan : g-alinlang ??
  • lalung-lalo
  • mangitlog : gitlog
  • mangingisdang : gingisda
  • napapakinggan : pakingg
  • pagkakasunod-sunod : sunod-sunod???
  • pinagtratrabahuhan : ratrabaho ???
  • 2nd pass
  • bibigay = igay?
  • if prefix[-1] = c >> should be v + c
  • kaluguran : lugor
  • partial >> if token[0] == token[1][0:len(token[0])] >> ret token[1]
  • prefix + partial dupli
  • prefix >> if - in token > if tok - prefix != tok2 > return token
  • punong-bayan : punong-bay
  • tagpuan : puan
  • tsismis : sismis
  • katangi-tanging : tangi-tang
  • validation data
  • period tracker

tagalogstemmerpython's People

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.