def computeHighlighting(text): lastKwEnd = 0 spansBuilder = StyleSpansBuilder() for m in re.finditer(PATTERN,text): styleClass = "keyword" if m.group("keyword"): styleClass = "keyword" elif m.group("brace"): styleClass = "paren" elif m.group("comment"): styleClass = "comment" elif m.group("types"): styleClass = "types" elif m.group("cond"): styleClass = "conditional" spansBuilder.add(Collections.emptyList(), m.start() - lastKwEnd) spansBuilder.add(Collections.singleton(styleClass), m.end() - m.start()) lastKwEnd = m.end() spansBuilder.add(Collections.emptyList(), len(text)- lastKwEnd) return spansBuilder.create()
def getTupleFromSentence(cls, sentence): """ generated source for method getTupleFromSentence """ if isinstance(sentence, (GdlProposition, )): return Collections.emptyList() # A simple crawl through the sentence. tuple_ = ArrayList() try: addBodyToTuple(sentence.getBody(), tuple_) except RuntimeException as e: raise RuntimeException(e.getMessage() + "\nSentence was " + sentence) return tuple_
def getSourceConjunctChildren(self): """ generated source for method getSourceConjunctChildren """ children = ArrayList() # If we are already using functions, short-circuit to cut off # repetition of the search space for index in functionalConjunctIndices: if index != -1: return Collections.emptyList() # This means we want a reference to the original list of conjuncts. lastSourceConjunctIndex = -1 if not self.sourceConjunctIndices.isEmpty(): lastSourceConjunctIndex = self.sourceConjunctIndices.get(len(self.sourceConjunctIndices) - 1) i = lastSourceConjunctIndex + 1 while i < len(self.sourceConjunctCandidates): children.add(IterationOrderCandidate(self, i)) i += 1 return children
def getRule(cls, head): """ generated source for method getRule """ empty = Collections.emptyList() return cls.getRule(head, empty)
def getRelation(cls, name): """ generated source for method getRelation """ empty = Collections.emptyList() return cls.getRelation(name, empty)
from java.util import Collections x = Collections.emptyList() s = x.size()
def getPayload(self): if self.current is None: return Collections.emptyList() return self.current.getPayload()
def getPayload(self): if self.current is None: return Collections.emptyList() return self.current.getPayload()
def getBody(self): """ generated source for method getBody """ return Collections.emptyList()