How to use the pyarabic.arabrepr.arepr function in PyArabic

To help you get started, we’ve selected a few PyArabic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github linuxscout / alyahmor / tests / test_print_affixes.py View on Github external
def main(args):

    generator = alyahmor.genelex.genelex()
    print ('NOUN_AFFIX_LIST=')
    noun_affixes = generator.generate_affix_list(word_type="noun", vocalized=False)
    print(arepr(noun_affixes).replace(',', ',\n'))
    
    print('VERB_AFFIX_LIST=')
    verb_affixes = generator.generate_affix_list(word_type="verb", vocalized=False)
    print(arepr(verb_affixes).replace('],', '],\n'))
    print(arepr(verb_affixes).replace(',', ',\n'))
    return 0
if __name__ == '__main__':
github linuxscout / alyahmor / tests / test_print_affixes.py View on Github external
def main(args):

    generator = alyahmor.genelex.genelex()
    print ('NOUN_AFFIX_LIST=')
    noun_affixes = generator.generate_affix_list(word_type="noun", vocalized=False)
    print(arepr(noun_affixes).replace(',', ',\n'))
    
    print('VERB_AFFIX_LIST=')
    verb_affixes = generator.generate_affix_list(word_type="verb", vocalized=False)
    print(arepr(verb_affixes).replace('],', '],\n'))
    print(arepr(verb_affixes).replace(',', ',\n'))
    return 0
if __name__ == '__main__':
github linuxscout / alyahmor / tests / test_print_affixes.py View on Github external
def main(args):

    generator = alyahmor.genelex.genelex()
    print ('NOUN_AFFIX_LIST=')
    noun_affixes = generator.generate_affix_list(word_type="noun", vocalized=False)
    print(arepr(noun_affixes).replace(',', ',\n'))
    
    print('VERB_AFFIX_LIST=')
    verb_affixes = generator.generate_affix_list(word_type="verb", vocalized=False)
    print(arepr(verb_affixes).replace('],', '],\n'))
    print(arepr(verb_affixes).replace(',', ',\n'))
    return 0
if __name__ == '__main__':
github linuxscout / alyahmor / tests / test_genelex.py View on Github external
#~ print(u"\n".join((unv_forms)).encode('utf8'))
            voc_forms = generator.get_vocalized_forms(list_forms)
            #~ print(u"\n".join((voc_forms)).encode('utf8')) 
            voc_forms_dict = generator.get_vocalized_forms_dict(list_forms)
            print(arepr(voc_forms_dict).replace('],', '],\n'))

        if wtype == "verb":
            print('************verb*****')
            list_forms =generator.generate_verb_forms(word)
            #~ print(arepr(verb_forms).replace('),', '),\n').replace('],', '],\n'))
            unv_forms = generator.get_unvocalized_forms(list_forms)
            #~ print(u"\n".join((unv_forms)).encode('utf8'))
            voc_forms = generator.get_vocalized_forms(list_forms)
            #~ print(u"\n".join((voc_forms)).encode('utf8'))
            voc_forms_dict = generator.get_vocalized_forms_dict(list_forms[:10])
            print(arepr(voc_forms_dict).replace('],', '],\n'))
github linuxscout / arabicstopwords / scripts / pydict.py View on Github external
def add_footer(self):
        """close the data set, used for ending xml, or sql"""
        
        text = "STOPWORDS="
        text += arepr(self.STOPWORDS).decode('utf8')
        if self.generate_all_forms : 
            text += "\n\nSTOPWORDS_INDEX="     
            text += arepr(self.STOPWORDS_INDEX).decode('utf8')
        # add newlines for more readability
        text = text.replace('}],', '}],\n')
        text = text.replace('],', '],\n')            
        text = text.replace('),', '),\n')            
        
        return text
github linuxscout / arramooz / scripts / verbs / gen_verb_dict.py View on Github external
def print_tuple(self, vdict):
        """
        convert tuple to string
        """
        if type(vdict) is list:
            print arepr(vdict)
        if "text" in vdict:
            return vdict['text']
        else:
            return u'\t'.join([
            vdict["word"],
            vdict["triliteral"],
            vdict["root"],
            vdict["future_type"],
            vdict["transitive"],
            str(vdict["nb_trans"]),
            vdict["object_type"],
            vdict["reflexive_type"],
            vdict["tenses"],
            vdict["model"],
            str(vdict["nb_case"]),
            vdict["verb_cat"],
github linuxscout / arabicstopwords / scripts / pydict.py View on Github external
def add_footer(self):
        """close the data set, used for ending xml, or sql"""
        
        text = "STOPWORDS="
        text += arepr(self.STOPWORDS).decode('utf8')
        if self.generate_all_forms : 
            text += "\n\nSTOPWORDS_INDEX="     
            text += arepr(self.STOPWORDS_INDEX).decode('utf8')
        # add newlines for more readability
        text = text.replace('}],', '}],\n')
        text = text.replace('],', '],\n')            
        text = text.replace('),', '),\n')            
        
        return text