How to use the underthesea.corpus.DictionaryLoader function in underthesea

To help you get started, we’ve selected a few underthesea 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 undertheseanlp / underthesea / underthesea / feature_engineering / feature.py View on Github external
# sample tagged sentence
# ===========================
# this     A
# is       B
# a        C
# sample   D
# sentence E
#

import re

from os.path import join, dirname

from underthesea.corpus import DictionaryLoader

words = DictionaryLoader(join(dirname(__file__), "Viet74K.txt")).words
lower_words = set([word.lower() for word in words])

def text_lower(word):
    return word.lower()


def text_isdigit(word):
    return str(word.isdigit())


def text_isallcap(word):
    for letter in word:
        if not letter.istitle():
            return False
    return True
github undertheseanlp / underthesea / underthesea / word_tokenize / tagged_feature.py View on Github external
#          .is_digit
#            \_ function
#
# ===========================
# sample tagged sentence
# ===========================
# this     A
# is       B
# a        C
# sample   D
# sentence E


import re
from underthesea.corpus import DictionaryLoader
words = DictionaryLoader("Viet74K.txt").words
lower_words = set([word.lower() for word in words])


def text_lower(word):
    return word.lower()


def text_isdigit(word):
    return str(word.isdigit())


def text_isallcap(word):
    for letter in word:
        if not letter.istitle():
            return False
    return True
github undertheseanlp / ner / util / models / ner_1 / tagged_feature.py View on Github external
#          .is_digit
#            \_ function
#
# ===========================
# sample tagged sentence
# ===========================
# this     A
# is       B
# a        C
# sample   D
# sentence E


import re
from underthesea.corpus import DictionaryLoader
words = DictionaryLoader("Viet74K.txt").words
lower_words = set([word.lower() for word in words])


def text_lower(word):
    return word.lower()


def text_isdigit(word):
    return str(word.isdigit())


def text_isallcap(word):
    for letter in word:
        if not letter.istitle():
            return False
    return True
github undertheseanlp / underthesea / underthesea / feature_engineering / feature.py View on Github external
# sample tagged sentence
# ===========================
# this     A
# is       B
# a        C
# sample   D
# sentence E
#

import re

from os.path import join, dirname

from underthesea.corpus import DictionaryLoader

words = DictionaryLoader(join(dirname(__file__), "Viet74K.txt")).words
lower_words = set([word.lower() for word in words])

def text_lower(word):
    return word.lower()


def text_isdigit(word):
    return str(word.isdigit())


def text_isallcap(word):
    for letter in word:
        if not letter.istitle():
            return False
    return True
github undertheseanlp / underthesea / underthesea / chunking / tagged_feature.py View on Github external
#          .is_digit
#            \_ function
#
# ===========================
# sample tagged sentence
# ===========================
# this     A
# is       B
# a        C
# sample   D
# sentence E


import re
from underthesea.corpus import DictionaryLoader
words = DictionaryLoader("Viet74K.txt").words
lower_words = set([word.lower() for word in words])


def text_lower(word):
    return word.lower()


def text_isdigit(word):
    return str(word.isdigit())


def text_isallcap(word):
    for letter in word:
        if not letter.istitle():
            return False
    return True