def writeWikiFile(tag_name): #reads in all the example tags from the tag file entities = FileReadingFuncts.read_all_lines("tagFiles/{}.txt".format(tag_name))[:20] #gets the words related to these from wikipedia words = [] for entity in entities: words = words + WikipediaFuncts.get_words(entity) #writes these words to the output file output_file = "wiki/{}1.txt".format(tag_name) writeFile(words, output_file)
def get_examples(tag_name): inputFile = "tagFiles/" + tag_name + ".txt" examples = FileReadingFuncts.read_all_lines(inputFile) return examples
def get_examples(tag_name): file = "tagFiles/{}.txt".format(tag_name) examples = FileReadingFuncts.read_all_lines(file) return examples