Example #1
0
def fnMain1(text):
    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    google_token = loader(os.path.join(BASE_DIR, 'config/google.yaml'))
    if isinstance(text, six.binary_type):
        text = text.decode('utf-8')
    entities = extract_required_entities(text, google_token['token'])
    return entities
Example #2
0
def LTT_Main(path):
    text = ""
    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    google_token = loader(os.path.join(BASE_DIR, 'config/google.yaml'))
    text = detect_text(path, google_token['token'])
    #    language_id = gs.detect(text)
    tTxt, lng = translate_text("en", text)
    return tTxt, lng
Example #3
0
def fnMain(path):
    text = ""
    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    google_token = loader(os.path.join(BASE_DIR, 'config/google.yaml'))
    text = detect_text(path, google_token['token'])
    language_id = gs.detect(text)
    txt = gs.translate(text, language_id)
    return txt
Example #4
0
def fnMain1(text):
    BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    google_token = loader(os.path.join(BASE_DIR, 'config/google.yaml'))
    entities = extract_required_entities(text, google_token['token'])
    return entities