case class ContextualEntityRulerRules(entity: String, scopeWindowLevel: Option[String], prefixPatterns: Option[Array[String]], suffixPatterns: Option[Array[String]], scopeWindow: Option[(Int, Int)], prefixRegexes: Option[Array[String]], suffixRegexes: Option[Array[String]], replaceEntity: Option[String], mode: Option[String]) extends Serializable with Product

Represents rules used by the ContextualEntityRuler to update or filter chunks in text.

entity

The target entity to be modified. Example: "AGE"

scopeWindowLevel

Specifies the level of the scope window to consider. Valid values: "token" or "char". Default: "token".

prefixPatterns

Array of patterns (words/phrases) to search **before the entity**. If these patterns are found within the scope, they will contribute to matching. Example: ["years", "old"] matches entities preceded by "years" or "old."

suffixPatterns

Array of patterns (words/phrases) to search **after the entity**. If these patterns are found within the scope, they will contribute to matching. Example: ["years", "old"] matches entities followed by "years" or "old."

scopeWindow

A tuple defining the range of tokens or characters (based on scopeWindowLevel) to include in the scope. Default: (1, 1).

  • Both integers must be non-negative or (-1, -1) for no scope limit. Example: (2, 3) means 2 tokens/characters before and 3 after the entity are considered.
prefixRegexes

Array of regular expressions to search **before the entity**. These regexes define more complex matching patterns for prefixes. Example: ["\\b(years|months)\\b"] matches words like "years" or "months" as prefixes.

suffixRegexes

Array of regular expressions to search **after the entity**. These regexes define more complex matching patterns for suffixes. Example: ["\\b(old|young)\\b"] matches words like "old" or "young" as suffixes.

replaceEntity

Optional string specifying the new entity to replace the target entity with. Example: "AGE_RANGE" replaces "AGE" with "AGE_RANGE" in matching cases.

mode

Specifies the operational mode for the rules. Possible values depend on the use case (e.g., "filter", "replace").

Linear Supertypes
Product, Equals, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ContextualEntityRulerRules
  2. Product
  3. Equals
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ContextualEntityRulerRules(entity: String, scopeWindowLevel: Option[String], prefixPatterns: Option[Array[String]], suffixPatterns: Option[Array[String]], scopeWindow: Option[(Int, Int)], prefixRegexes: Option[Array[String]], suffixRegexes: Option[Array[String]], replaceEntity: Option[String], mode: Option[String])

    entity

    The target entity to be modified. Example: "AGE"

    scopeWindowLevel

    Specifies the level of the scope window to consider. Valid values: "token" or "char". Default: "token".

    prefixPatterns

    Array of patterns (words/phrases) to search **before the entity**. If these patterns are found within the scope, they will contribute to matching. Example: ["years", "old"] matches entities preceded by "years" or "old."

    suffixPatterns

    Array of patterns (words/phrases) to search **after the entity**. If these patterns are found within the scope, they will contribute to matching. Example: ["years", "old"] matches entities followed by "years" or "old."

    scopeWindow

    A tuple defining the range of tokens or characters (based on scopeWindowLevel) to include in the scope. Default: (1, 1).

    • Both integers must be non-negative or (-1, -1) for no scope limit. Example: (2, 3) means 2 tokens/characters before and 3 after the entity are considered.
    prefixRegexes

    Array of regular expressions to search **before the entity**. These regexes define more complex matching patterns for prefixes. Example: ["\\b(years|months)\\b"] matches words like "years" or "months" as prefixes.

    suffixRegexes

    Array of regular expressions to search **after the entity**. These regexes define more complex matching patterns for suffixes. Example: ["\\b(old|young)\\b"] matches words like "old" or "young" as suffixes.

    replaceEntity

    Optional string specifying the new entity to replace the target entity with. Example: "AGE_RANGE" replaces "AGE" with "AGE_RANGE" in matching cases.

    mode

    Specifies the operational mode for the rules. Possible values depend on the use case (e.g., "filter", "replace").

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. val entity: String
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. val mode: Option[String]
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. val prefixPatterns: Option[Array[String]]
  16. val prefixRegexes: Option[Array[String]]
  17. val replaceEntity: Option[String]
  18. val scopeWindow: Option[(Int, Int)]
  19. val scopeWindowLevel: Option[String]
  20. val suffixPatterns: Option[Array[String]]
  21. val suffixRegexes: Option[Array[String]]
  22. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Product

Inherited from Equals

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped