Esempio n. 1
0
File: tp3.py Progetto: joelcn/uni
def toggleGH():
    global doc
    global t
    if (doc):
        doc = False
        t = fileMK.readFilesInArray(corpusPath, doc)
    else:
        doc = True
        t = fileMK.readFilesInArray(corpusPath, doc)
Esempio n. 2
0
File: tp3.py Progetto: joelcn/uni
#!C:/Python33/python.exe -u
# -*- coding: ascii -*-
import re
import math
import fileMK

corpusPath = "D:\\nlp\\corpus\\"
outputPath = "D:\\nlp\\output\\"

doc = False

t = []
t = fileMK.readFilesInArray(corpusPath, doc)

def choose():
    printInfo()
    ex = input()
    if (ex == "1"):
        task1()
        choose()
    elif (ex == "2"):
        task2()
        choose()
    elif (ex == "3"):
        task3()
        choose()
    elif (ex == "4"):
        task4()
        choose()
    elif (ex == "5"):
        task5()
Esempio n. 3
0
File: tp2.py Progetto: joelcn/uni
#!C:/Python33/python.exe -u
# -*- coding: ascii -*-
import fileMK

path = "D:\\nlp\\corpus"

t = []
t = fileMK.readFilesInArray(path, True)

def choose():
        print("")
        print(" --------------------------------------------------------------------")
        print(" 1 = Number of Tags in Document.")
        print(" 2 = Headlines/Titles in Document.")
        print(" 3 = Text of Docno.")
        print(" 4 = Number of Tokens in Corpus.")
        print(" Else Exit")
        print(" --------------------------------------------------------------------")
        ex = input()
        if (ex == "1"):
                task1()
        if (ex == "2"):
                task2()
        if (ex == "3"):
                task3()
        if (ex == "4"):
                task4()

def task1():
    # Task 1
    for i in range(len(t)):