@@ -1219,16 +1219,17 @@ def initCommonOutputs():
12191219
12201220 cfile .close ()
12211221
1222- def getGoodSamaritanCharsets (part , prevValue , originalCharset ):
1222+ def getGoodSamaritanParameters (part , prevValue , originalCharset ):
12231223 ###wild card . (dot) is supported for compatibility with threading
12241224 if kb .commonOutputs is None :
12251225 initCommonOutputs ()
12261226
12271227 if not part or not prevValue : #is not None and != ""
1228- return None , originalCharset
1228+ return None , None , originalCharset
12291229
12301230 predictionSet = set ()
12311231 wildIndexes = []
1232+ singleValue = None
12321233
12331234 if prevValue [- 1 ] != '.' :
12341235 prevValue += '.'
@@ -1244,6 +1245,7 @@ def getGoodSamaritanCharsets(part, prevValue, originalCharset):
12441245 if part in kb .commonOutputs :
12451246 for item in kb .commonOutputs [part ]:
12461247 if re .search ('\A%s' % prevValue , item ):
1248+ singleValue = item
12471249 for index in wildIndexes :
12481250 char = item [index ]
12491251
@@ -1260,10 +1262,13 @@ def getGoodSamaritanCharsets(part, prevValue, originalCharset):
12601262 predictedCharset .append (ordChar )
12611263
12621264 predictedCharset .sort ()
1265+
1266+ if len (predictedCharset ) > 1 :
1267+ singleValue = None
12631268
1264- return predictedCharset , otherCharset
1269+ return singleValue , predictedCharset , otherCharset
12651270 else :
1266- return None , originalCharset
1271+ return None , None , originalCharset
12671272
12681273def getCompiledRegex (regex ):
12691274 if regex in __compiledRegularExpressions :
0 commit comments