Example #1
0
def getNouns(NLUOutput, subjectList):
    returnList = []

    for subject in subjectList:
        a = []
        if NLUOutput[0][subject] in pronounKeys:
            a = [pronounSubjects[NLUOutput[0][subject]], pronounObjects[NLUOutput[0][subject]]]
        elif subject == "sort":
            order = NLUOutput[0].get("order")
            sortType = NLUOutput[0][subject]
            b = ""
            if order == "asc":
                if sortType == "gross":
                    b = "least profitable"
                if sortType == "rating":
                    b = "least popular"
                if sortType == "year":
                    b = "oldest"
            else:  # if order == "desc":
                if sortType == "gross":
                    b = "most profitable"
                if sortType == "rating":
                    b = "most popular"
                if sortType == "year":
                    b = "newest"
            a = [b, b]
        else:
            a = [nlgu.flipPersons(subject, NLUOutput[0][subject]), nlgu.flipPersons(subject, NLUOutput[0][subject])]
        returnList.append(a)
    return returnList
Example #2
0
def printSmallItemList(itemType, resultList):
    n = 0
    rstring = ""
    for result in resultList:
        n += 1
        if n == len(resultList):
            rstring += " and " + nlgu.flipPersons(itemType, str(result))
        elif n == len(resultList) - 1:
            rstring += nlgu.flipPersons(itemType, str(result))
        else:
            rstring += nlgu.flipPersons(itemType, str(result)) + ", "
    return rstring
Example #3
0
def printSmallItemList(itemType, resultList):
    n = 0
    rstring = ""
    for result in resultList:
        n += 1
        if n == len(resultList):
            rstring += " and " + nlgu.flipPersons(itemType, str(result))
        elif n == len(resultList) - 1:
            rstring += nlgu.flipPersons(itemType, str(result))
        else:
            rstring += nlgu.flipPersons(itemType, str(result)) + ", "
    return rstring
Example #4
0
def getNouns(NLUOutput, subjectList):
    returnList = []

    for subject in subjectList:
        a = []
        if NLUOutput[0][subject] in pronounKeys:
            a = [
                pronounSubjects[NLUOutput[0][subject]],
                pronounObjects[NLUOutput[0][subject]]
            ]
        elif subject == "sort":
            order = NLUOutput[0].get("order")
            sortType = NLUOutput[0][subject]
            b = ""
            if order == "asc":
                if sortType == "gross":
                    b = "least profitable"
                if sortType == "rating":
                    b = "least popular"
                if sortType == "year":
                    b = "oldest"
            else:  #if order == "desc":
                if sortType == "gross":
                    b = "most profitable"
                if sortType == "rating":
                    b = "most popular"
                if sortType == "year":
                    b = "newest"
            a = [b, b]
        else:
            a = [
                nlgu.flipPersons(subject, NLUOutput[0][subject]),
                nlgu.flipPersons(subject, NLUOutput[0][subject])
            ]
        returnList.append(a)
    return returnList
Example #5
0
def printBigItemList(itemType, resultList):
    rstring = ""
    for result in resultList:
        rstring += nlgu.flipPersons(itemType, str(result)) + "\n"
    return rstring
    pass
Example #6
0
def printItem(itemType, result):
    return nlgu.flipPersons(itemType, str(result))
Example #7
0
def printBigItemList(itemType, resultList):
    rstring = ""
    for result in resultList:
        rstring += nlgu.flipPersons(itemType, str(result)) + "\n"
    return rstring
    pass
Example #8
0
def printItem(itemType, result):
    return nlgu.flipPersons(itemType, str(result))