https://github.com/swanhtet1992/ReSegment
Burmese (Myanmar) syllable level segmentation with regex.
https://github.com/swanhtet1992/ReSegment
burmese-nlp myanmar-nlp myanmar-text nlp segmentation
Last synced: about 2 months ago
JSON representation
Burmese (Myanmar) syllable level segmentation with regex.
- Host: GitHub
- URL: https://github.com/swanhtet1992/ReSegment
- Owner: swanhtet1992
- Created: 2017-04-26T19:11:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-11T07:52:00.000Z (over 5 years ago)
- Last Synced: 2024-07-31T20:29:53.840Z (9 months ago)
- Topics: burmese-nlp, myanmar-nlp, myanmar-text, nlp, segmentation
- Language: Java
- Size: 8.79 KB
- Stars: 27
- Watchers: 2
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-Myanmar - ReSegment
README
# ReSegment
This is Burmese syllable level segmentation by using the power of regex.
The original regex is based on [sylbreak](https://github.com/ye-kyaw-thu/sylbreak) by [Ko Ye Kyaw Thu](https://github.com/ye-kyaw-thu/).After testing with various news articles, these are the additional improvements:
- Added support for numbers. (`၁၀၀ကျပ်` will be segmented into `['၁၀၀', 'ကျပ်']`)
- Added support for words with special killers. This scenario can be see mostly in English names like `ဘတ်ဇ်ခရောရှ့်ဂတ်` -> `['ဘတ်ဇ်', 'ခ', 'ရောရှ့်', 'ဂတ်']` and `ဂျော့ချ်ဘုရှ်` -> `['ဂျော့ချ်', 'ဘုရှ်']`.
- Added support for updated `tone mark` and `killer` rule. (`သ + င + ့ + ်` or `သ + င + ် + ့` will be able to segment correctly into `['သင့်']`)# TEST
Text: `ဝန်ကြီးချုပ်ဦးဖြိုးမင်းသိန်း ခွင့်ထပ်တိုင် ရန်ကုန်တိုင်းလွှတ်တော်မှာ YBS စနစ်ပြုပြင်ပြောင်းလဲဖို့ တင်သွင်းတဲ့အဆိုအတည်ပြုဖို့၊ မပြုဖို့ ဆုံးဖြတ်မယ့်မနက်ဖြန်လွှတ်တော်အစည်းအဝေးကိုလည်း ဝန်ကြီးချုပ်ဦးဖြိုးမင်းသိန်းက ခွင့်ထပ်တိုင်ခဲ့ကြောင်းသိရပါတယ်`Result: `['ဝန်', 'ကြီး', 'ချုပ်', 'ဦး', 'ဖြိုး', 'မင်း', 'သိန်း', ' ', 'ခွင့်', 'ထပ်', 'တိုင်', ' ', 'ရန်', 'ကုန်', 'တိုင်း', 'လွှတ်', 'တော်', 'မှာ', ' YBS ', 'စ', 'နစ်', 'ပြု', 'ပြင်', 'ပြောင်း', 'လဲ', 'ဖို့', ' ', 'တင်', 'သွင်း', 'တဲ့', 'အ', 'ဆို', 'အ', 'တည်', 'ပြု', 'ဖို့', '၊', ' ', 'မ', 'ပြု', 'ဖို့', ' ', 'ဆုံး', 'ဖြတ်', 'မယ့်', 'မ', 'နက်', 'ဖြန်', 'လွှတ်', 'တော်', 'အ', 'စည်း', 'အ', 'ဝေး', 'ကို', 'လည်း', ' ', 'ဝန်', 'ကြီး', 'ချုပ်', 'ဦး', 'ဖြိုး', 'မင်း', 'သိန်း', 'က', ' ', 'ခွင့်', 'ထပ်', 'တိုင်', 'ခဲ့', 'ကြောင်း', 'သိ', 'ရ', 'ပါ', 'တယ်']`
--------------------
Text: `စီအိုင်အေက နှိပ်စက်စစ်ဆေးမှု တွေလုပ်ခဲ့ အမေရိကန်-ဗဟိုထောက်လှမ်းရေး ဌာန CIA ဟာ သမ္မတဟောင်း ဂျော့ချ်ဘုရှ် လက်ထက် စက်တင်ဘာ ၁၁ ရက် တိုက်ခိုက်ခံရမှု နောက်ပိုင်း စစ်ဆေးမှုတွေလုပ်ရာမှာ နှိပ်စက်ညှင်းပန်းမှုတွေ ကျူးလွန်ခဲ့ဖူးတယ်လို့ စီအိုင်အေရဲ့ အကြီးအကဲဟောင်း ဘတ်ဇ်ခရောရှ့်ဂတ်က ဘီဘီစီကို ပြောခဲ့ပါတယ်။`Result: `['စီ', 'အိုင်', 'အေ', 'က', ' ', 'နှိပ်', 'စက်', 'စစ်', 'ဆေး', 'မှု', ' ', 'တွေ', 'လုပ်', 'ခဲ့', ' ', 'အ', 'မေ', 'ရိ', 'ကန်', '-', 'ဗ', 'ဟို', 'ထောက်', 'လှမ်း', 'ရေး', ' ', 'ဌာ', 'န', ' CIA ', 'ဟာ', ' ', 'သမ္မ', 'တ', 'ဟောင်း', ' ', 'ဂျော့ချ်', 'ဘုရှ်', ' ', 'လက်', 'ထက်', ' ', 'စက်', 'တင်', 'ဘာ', ' ', '၁၁', ' ', 'ရက်', ' ', 'တိုက်', 'ခိုက်', 'ခံ', 'ရ', 'မှု', ' ', 'နောက်', 'ပိုင်း', ' ', 'စစ်', 'ဆေး', 'မှု', 'တွေ', 'လုပ်', 'ရာ', 'မှာ', ' ', 'နှိပ်', 'စက်', 'ညှင်း', 'ပန်း', 'မှု', 'တွေ', ' ', 'ကျူး', 'လွန်', 'ခဲ့', 'ဖူး', 'တယ်', 'လို့', ' ', 'စီ', 'အိုင်', 'အေ', 'ရဲ့', ' ', 'အ', 'ကြီး', 'အ', 'ကဲ', 'ဟောင်း', ' ', 'ဘတ်ဇ်', 'ခ', 'ရောရှ့်', 'ဂတ်', 'က', ' ', 'ဘီ', 'ဘီ', 'စီ', 'ကို', ' ', 'ပြော', 'ခဲ့', 'ပါ', 'တယ်', '။']`
--------------------
Text: `တောင်ကိုရီးယား အခြေစိုက် Posco Daewoo နှင့် သြစတြေးလျအခြေစိုက် Woodside တို့ အကျိုးတူ ပူးပေါင်းဆောင်ရွက်နေသည့် ရခိုင်ကမ်းလွန်ရှိ AD-7`Result: `['တောင်', 'ကို', 'ရီး', 'ယား', ' ', 'အ', 'ခြေ', 'စိုက်', ' Posco Daewoo ', 'နှင့်', ' ', 'သြ', 'စ', 'တြေး', 'လျ', 'အ', 'ခြေ', 'စိုက်', ' Woodside ', 'တို့', ' ', 'အ', 'ကျိုး', 'တူ', ' ', 'ပူး', 'ပေါင်း', 'ဆောင်', 'ရွက်', 'နေ', 'သည့်', ' ', 'ရ', 'ခိုင်', 'ကမ်း', 'လွန်', 'ရှိ', 'AD-7']`
--------------------
Text: `၂၀၁၈ခုနှစ်အာရှအားကစားပြိုင်ပွဲတွင် အားကစားနည်းအရေအတွက် တိုးမြင့်လာခဲ့`Result: `['၂၀၁၈', 'ခု', 'နှစ်', 'အာ', 'ရှ', 'အား', 'က', 'စား', 'ပြိုင်', 'ပွဲ', 'တွင်', ' ', 'အား', 'က', 'စား', 'နည်း', 'အ', 'ရေ', 'အ', 'တွက်', ' ', 'တိုး', 'မြင့်', 'လာ', 'ခဲ့']`
--------------------
Text: `ပိဿာချိန်၁၀သားရှိသောကြက်သားများချက်ပြုတ်ကျွေးမွေးလှူဒါန်းသွားသည့်အတွက်ကျေးဇူးတင်ပါသည်။`Result: `['ပိ', 'ဿာ', 'ချိန်', '၁၀', 'သား', 'ရှိ', 'သော', 'ကြက်', 'သား', 'များ', 'ချက်', 'ပြုတ်', 'ကျွေး', 'မွေး', 'လှူ', 'ဒါန်း', 'သွား', 'သည့်', 'အ', 'တွက်', 'ကျေး', 'ဇူး', 'တင်', 'ပါ', 'သည်', '။']`
# NOTE
This is just a simple proof of concept repo. Although I have tested the regex with various news articles, errors may still exist. Therefore, the code is provided “AS IS” without any warranty of any kind.# Contributors
Java and Javascript versions are contributed by [chanmratekoko](https://github.com/chanmratekoko) so that you don't have to convert the regex on your own. 🤠