Advertisement
l33tb0mb3r

isZawgyi.py

Sep 5th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.27 KB | None | 0 0
  1. import re
  2.  
  3. def isZawgyi(input):
  4.         input = input.strip().split(" ")
  5.         print(input)
  6.        
  7.         zawgyiRegex="\u1031\u103B|^\u1031|^\u103B|[\u1022-\u1030\u1032-\u1039\u103B-\u103D\u1040-\u104F]\u103B|\u1039$|\u103D\u103C|\u103B\u103C|[\u1000-\u1021]\u1039[\u101A\u101B\u101D\u101F\u1022-\u102A\u1031\u1037-\u1039\u103B\u1040-\u104F]|\u102E[\u102D\u103E\u1032]|\u1032[\u102D\u102E]|[\u1090-\u1099][\u102B-\u1030\u1032\u1037\u103C-\u103E]|[\u1000-\u102A]\u103A[\u102C-\u102E\u1032-\u1036]|[\u1023-\u1030\u1032-\u1039\u1040-\u104F]\u1031|[\u107E-\u1084][\u1001\u1003\u1005-\u100F\u1012-\u1014\u1016-\u1018\u101F]|\u1025\u1039|[\u1081\u1083]\u108F|\u108F[\u1060-\u108D]|[\u102D-\u1030\u1032\u1036\u1037]\u1039|\u102C\u1039|\u101B\u103C|[^\u1040-\u1049]\u1040\u102D|\u1031?\u1040[\u102B\u105A\u102E-\u1030\u1032\u1036-\u1038]|\u1031?\u1047[\u102C-\u1030\u1032\u1036-\u1038]|[\u102F\u1030\u1032]\u1094|\u1039[\u107E-\u1084]"
  8.  
  9.         pattern=re.compile(zawgyiRegex)
  10.  
  11.         for i in input:
  12.                 match = pattern.search(i)
  13.                 if match:
  14.                         print(match)
  15.                         print("Zawgyi")
  16.  
  17.        
  18.        
  19.  
  20.  
  21.  
  22. teststring = "သီဟိုဠ္မွ ဉာဏ္ႀကီးရွင္သည္ အာယုဝဍ္ဎနေဆးညႊန္းစာကို ဇလြန္ေဈးေဘး ဗာဒံပင္ထက္ အဓိ႒ာန္လ်က္ ဂဃနဏဖတ္ခဲ့သည္။"
  23.  
  24. teststring2 = "သီဟိုဠ်မှ ဉာဏ်ကြီးရှင်သည် အာယုဝဍ်ဎနဆေးညွှန်းစာကို ဇလွန်ဈေးဘေး ဗာဒံပင်ထက် အဓိဋ္ဌာန်လျက် ဂဃနဏဖတ်ခဲ့သည်။"
  25.  
  26. teststring3 = "စာရင္း နာမည္မ်ား ဖုန္းနံပါတ္မ်ား သီခ်င္းမ်ား အေၾကာင္းအရာ ေက်ာင္းသားနာမည္ ‌ေဒတာ"
  27.  
  28. teststring4 = "စာရင်း နာမည်များ ဖုန်းနံပါတ်များ သီချင်းများ အကြောင်းအရာ ကျောင်းသားနာမည် ဒေတာ"
  29.  
  30. isZawgyi(teststring)
  31. isZawgyi(teststring4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement