예제 #1
0
파일: repl.py 프로젝트: cuijiaxing/nlp
def readA(fileloc):
    article = []
    V = collections.Counter()
    N = 0
    article = api.parsefile(fileloc)
    N = ks.trainIR(article, V)
    return [article, V, N]
예제 #2
0
파일: preprocess.py 프로젝트: pocketman/nlp
def main(fileloc, out):
    article = api.parsefile(fileloc)
    fout = open(out, 'w')
    for s in article:
        if not containsPronoun(s):
            fout.write(api.toString(s)+"\n")
    fout.close()
    return