Beispiel #1
0
 def applyAmbiguitiesToRules(cls, description, ambiguitiesByOriginalForm, model):
     """ generated source for method applyAmbiguitiesToRules """
     result = ImmutableList.builder()
     for gdl in description:
         if isinstance(gdl, (GdlRule, )):
             result.addAll(applyAmbiguities(gdl, ambiguitiesByOriginalForm, model))
         else:
             result.add(gdl)
     return result.build()
Beispiel #2
0
 def create(cls, form, domain):
     """ generated source for method create """
     domainsForSlotsBuilder = Lists.newArrayList()
     i = 0
     while i < form.getTupleSize():
         domainsForSlotsBuilder.add(ImmutableSet.builder())
         i += 1
     for sentence in domain:
         assert form.matches(sentence)
         if len(tuple_) != form.getTupleSize():
             raise IllegalArgumentException()
         while i < len(tuple_):
             domainsForSlotsBuilder.get(i).add(constant)
             i += 1
     domainsForSlots = ImmutableList.builder()
     for builder in domainsForSlotsBuilder:
         domainsForSlots.add(builder.build())
     return FullSentenceFormDomain(form, ImmutableList.copyOf(domain), domainsForSlots.build())