diff --git a/unnaturalcode/sourceModel.py b/unnaturalcode/sourceModel.py index 59b46bb..2e256aa 100644 --- a/unnaturalcode/sourceModel.py +++ b/unnaturalcode/sourceModel.py @@ -69,7 +69,10 @@ def predictLexed(self, lexemes): def windowedQuery(self, lexemes, returnWindows=True): lastWindowStarts = len(lexemes)-self.windowSize if lastWindowStarts < 1: - return [(lexemes, self.queryLexed(lexemes))] + if returnWindows: + return [(lexemes, self.queryLexed(lexemes))] + else: + return [(False, self.queryLexed(lexemes))] r = [] for i in range(0,lastWindowStarts+1): # remember range is [) end = i+self.windowSize