def on_uni2zgy_action_activate(self, action, data=None):
     view = self.window.get_active_view()
     if view:
         buff = view.get_buffer()
         strin = buff.get_property('text')
         strout = converter.convert(strin, "unicode", "zawgyi")
         buff.set_text(strout)
    def parse_item(self, response):
        hxs = HtmlXPathSelector(response)
        paragraphs = hxs.select(r'//p//text()')

        for paragraph in paragraphs:
            paragraph = paragraph.extract().strip()
            paragraph = converter.convert(paragraph, 'zawgyi', 'unicode')

            if is_large_paragraph(paragraph) and is_mainly_myanmar(paragraph):
                self.manager.add_item(paragraph)
Exemplo n.º 3
0
    def parse_item (self, response):
        hxs = HtmlXPathSelector(response)
        paragraphs = hxs.select(r"//div//text()")

        for paragraph in paragraphs:
            paragraph = paragraph.extract ().strip()
            paragraph = converter.convert (paragraph, 'zawgyi','unicode')

            if is_large_paragraph(paragraph) and is_mainly_myanmar(paragraph):
                self.manager.add_item(paragraph)
Exemplo n.º 4
0
 def uni2zaw():
     m = Frame.m
     txt = m.get()
     root20 = tk.Tk()
     root20.title('Result(2ZawgyiMN)')
     conv = converter.convert(txt, 'unicode', 'zawgyi')
     print(conv)
     pyperclip.copy(conv)
     label20 = tk.Label(root20, text=conv, font=16)
     label20.pack(fill="x")
     root20.mainloop()
Exemplo n.º 5
0
 def zaw2uni():
     m = Frame.m
     txt = m.get()
     root19 = tk.Tk()
     root19.title('Result(2UnicordMN)')
     conv = converter.convert(txt, 'unicode', 'zawgyi')
     print(conv)
     pyperclip.copy(conv)
     label19 = tk.Label(root19, text=conv, font=16)
     label19.pack(fill="x")
     root19.mainloop()
Exemplo n.º 6
0
def test_uni2zgy_conversion():
    try:
        path = os.path.join(os.path.dirname(__file__), 'data', 'converter.txt')
        fil = open(path, 'r', encoding='utf-8')
    except Exception as e:
        sys.exit(-1)

    for line in fil.readlines():
        line = line.strip()
        unistr, zgystr = line.split('\t')

        assert zgystr == converter.convert(unistr, 'unicode', 'zawgyi')
        fil.close()
Exemplo n.º 7
0
def test_uni2zgy_conversion():
    try:
        path = os.path.join(
            os.path.dirname(__file__), 'data', 'uni2zgy-conversion.txt'
        )
        fil = open(path, 'r', encoding='utf-8')
    except Exception as e:
        sys.exit(-1)

    for line in fil.readlines():
        line = line.strip()
        unistr, zgystr = line.split('\t')

        assert zgystr == converter.convert(unistr, 'unicode', 'zawgyi')
        fil.close()
Exemplo n.º 8
0
 def zgy_repr (string):
     zgy_string = converter.convert(string, 'unicode', 'zawgyi')
     #zfil.write (zgy_string + u'\t\t' + string + u'\n')
     utf_repr = u' '.join ([repr(c)[3:-1] for c in zgy_string]).replace ("u", "U+").upper ()
     return zgy_string + ' (' + utf_repr + ')'
Exemplo n.º 9
0
#!/usr/bin/python

import gtk
import myanmar.converter as converter

clipboard = gtk.clipboard_get()
clipboard.set_text(converter.convert(clipboard.wait_for_text(), "zawgyi", "unicode"))
clipboard.store()