예제 #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
예제 #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
예제 #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
예제 #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
예제 #5
0
def printBigItemList(itemType, resultList):
    rstring = ""
    for result in resultList:
        rstring += nlgu.flipPersons(itemType, str(result)) + "\n"
    return rstring
    pass
예제 #6
0
def printItem(itemType, result):
    return nlgu.flipPersons(itemType, str(result))
예제 #7
0
def printBigItemList(itemType, resultList):
    rstring = ""
    for result in resultList:
        rstring += nlgu.flipPersons(itemType, str(result)) + "\n"
    return rstring
    pass
예제 #8
0
def printItem(itemType, result):
    return nlgu.flipPersons(itemType, str(result))