兄弟字符串 :a-b
给一个词典;计算传入词语的兄弟词数
def brotherWordCounts(file,word):
dict=dictLoad(file)
word1=sortWord(word)
wordLen=len(word)
return dict[wordLen].contains(word1)
def dictLoad(file):
dict=os.read(file)
dic=[][]
for line in dict:
dict[len(line.strip()].append(sortWord(line.strip()))
return dic
def sortWord(word):
list=array(word).sort()
return list.toString()
brotherWordCounts(file,word);
给定一个词,计算他的最大的对称词语数