Ejemplo n.º 1
0
def relativos():
    file_ = open('pronomes/relativos.txt', 'r')
    for line in file_.readlines():
        line = line.replace('\n', '').lstrip(' ').rstrip(' ')
        db_utils.create_node(node_id=line, node_type=d.PRONOME,
                             additional_params={'subcategoria': 'relativo'})
    file_.close()
Ejemplo n.º 2
0
def pessoais():
    position = 0
    file_ = open('pronomes/pessoais.txt', 'r')
    for line in file_.readlines():
        line = line.replace('\n', '').lstrip(' ').rstrip(' ')
        if '>' in line:
            position += 1
            continue
        if position == 0:
            db_utils.create_node(node_id=line, node_type=d.PRONOME)
        elif position == 1:
            db_utils.create_node(node_id=line, node_type=d.PRONOME,
                                 additional_params={'subcategoria': 'oblíquos átonos'})
        elif position == 2:
            db_utils.create_node(node_id=line, node_type=d.PRONOME,
                                 additional_params={'subcategoria': 'oblíquos tônicos'})
        elif position == 3:
            db_utils.create_node(node_id=line, node_type=d.PRONOME,
                                 additional_params={'subcategoria': 'tratamento'})
    file_.close()
Ejemplo n.º 3
0
# coding: utf-8
import os
import sys
project_path = os.path.abspath(__file__).split('/')
del project_path[-1]
del project_path[-1]
del project_path[-1]
sys.path.append(os.path.join('/'.join(project_path), 'generators'))
from generators.utils import db_utils
from generators.utils import defs as d
from generators.utils.filter_tables import artigos

print artigos

for it in artigos:
    get_data = db_utils.get_nodes(it, d.ARTIGO).data()
    if len(get_data) == 0:
        print it
        db_utils.create_node(it, d.ARTIGO)
Ejemplo n.º 4
0
def node(w):
    get_data = db_utils.get_nodes(w, TYPE).data()
    if len(get_data) == 0:
        db_utils.create_node(w, TYPE)
Ejemplo n.º 5
0
# coding: utf-8
import os
import sys
project_path = os.path.abspath(__file__).split('/')
del project_path[-1]
del project_path[-1]
del project_path[-1]
sys.path.append(os.path.join('/'.join(project_path), 'generators'))
from generators.utils import db_utils
from generators.utils import defs as d

file_ = open('conj.txt', 'r')
for line in file_.readlines():
    line = line.strip()
    w = line.strip().strip('\n')
    if line.strip() and line.strip() != '\n' and ' ' not in line:
        get_data = db_utils.get_nodes(w, d.CONJUNCAO).data()
        if len(get_data) == 0:
            print w
            db_utils.create_node(w, d.CONJUNCAO)