我已经在Python中编写了此函数,该函数接受元素的(子)列表,并返回其标签。关于如何构建Java API与Python创建的函数进行交互的任何技巧?
def match(x):
"""It takes a list of n criteria and it returns the corresponding label"""
import itertools
a = ['HISTORIQUE', 'INTERNET', 'MTN MONEY', 'MY BALANCE', 'MY NUMBER',
'SERVICE CLIENT', 'SMS PACKS', 'SOS CREDIT', 'purchase']
for element in list(enumerate(list(itertools.combinations(a,len(set(x)))))):
if set(element[1])==set(x):
return element[0]