Exemplo n.º 1
0
def main():
    # Check that only one argument was passed
    if len(sys.argv) != 2:
        print("Tokenize takes one text file as an argument.")
        return

    # pass the text file to the Tokenizer
    parser = Parser(sys.argv[1])

    # run the Tokenizer
    parser.run()

    # print the results
    parser.print_results_sorted()

    return
Exemplo n.º 2
0
def main():
    # Check that only one argument was passed
    if len(sys.argv) != 3:
        print("Tokenize takes two text files as an argument.")
        return

    # pass the text file to the Parser
    parser1 = Parser(sys.argv[1])
    parser2 = Parser(sys.argv[2])

    # run the Parsers
    parser1.run()
    parser2.run()

    # print the number of shared tokens
    parser1.compare(parser2)

    return