import spacy
import sys
import os
current = os.path.dirname(os.path.realpath(__file__))
parent = os.path.dirname(current)
sys.path.append(parent)
import aeg

#Initializes our custom trained model
trained_nlp = spacy.load("output/spacy_textcat/model-best")


answer = "Mike will likely prevail, be allowed to keep his driveway, and be awarded title of the five feet strip of land in which it encroached. His five foot encroachment along Daniel's lot meets the elements to prevail on a adverse possession claim. Namely, his use of the land was open and notorious; and in his continuous and exclusive exclusive use for the statutory period. Further, it was hostile, as he did not have Daniel's permission and used the land as if it were his own. While a majority of jurisdictions do not care about Daniel's mindset, it is not of importance as the fact pattern suggests Mike acted in good faith, and treated the five feet plot as his own."
sents = aeg.getSentences(answer)

#Printing categories: 
for sent in sents: 
    doc = trained_nlp(sent)
    print("===================================================")
    print(doc)
    print(doc.cats)
    print("---------------------------------------------------")