Context
¶
Search
Factor
for genericFactor
s to use in new context.Decorators for memoizing generic
Factor
s. Used when changing an abstractRule
from one concrete context to another.If a
list
has been passed in rather than adict
, uses the input as a series ofFactor
s to replace thegeneric_factors
from the calling object.Also, if
changes
contains a replacement for the calling object, the decorator returns the replacement and never calls the decorated function.- Parameters
factor – a
Factor
that is having its genericFactor
s replaced to change context (for instance, to change to the context of a different case involving parties represented by differentEntity
objects).changes – indicates which generic
Factor
s withinfactor
should be replaced and what they should be replaced with.context_opinion – a second object with generic factors that need to be searched when trying to resolve what a string in the changes parameter refers to.
- Returns
a new
Factor
object in the new context.