Class/Object

com.johnsnowlabs.nlp.util.regex

RuleFactory

Related Docs: object RuleFactory | package regex

Permalink

class RuleFactory extends RuleSymbols with Serializable

Regular Expressions rule manager. Applies rules based on Matching and Replacement strategies

Linear Supertypes
Serializable, Serializable, RuleSymbols, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RuleFactory
  2. Serializable
  3. Serializable
  4. RuleSymbols
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RuleFactory(matchStrategy: MatchStrategy, transformStrategy: TransformStrategy = TransformStrategy.NO_TRANSFORM)

    Permalink

    matchStrategy

    How to decide on regex search

    transformStrategy

    How to decide when replacing or transforming content with Regex

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val BREAK_INDICATOR: String

    Permalink

    Separation symbols for list items and numbers 

    Separation symbols for list items and numbers 

    Definition Classes
    RuleSymbols
  5. val COMMA: String

    Permalink

    looks up ,

    looks up ,

    Definition Classes
    RuleSymbols
  6. val DOT: String

    Permalink

    looks up .

    looks up .

    Definition Classes
    RuleSymbols
  7. val EXCLAMATION: String

    Permalink

    looks up !

    looks up !

    Definition Classes
    RuleSymbols
  8. val PROTECTION_MARKER_CLOSE: String

    Permalink
    Definition Classes
    RuleSymbols
  9. val PROTECTION_MARKER_OPEN: String

    Permalink

    Between punctuations marker

    Between punctuations marker

    Definition Classes
    RuleSymbols
  10. val QUESTION: String

    Permalink

    looks up ?

    looks up ?

    Definition Classes
    RuleSymbols
  11. val SEMICOLON: String

    Permalink

    looks up ;

    looks up ;

    Definition Classes
    RuleSymbols
  12. val UNPROTECTED_BREAK_INDICATOR: String

    Permalink

    Magic regex ensures no breaking within protection

    Magic regex ensures no breaking within protection

    Definition Classes
    RuleSymbols
  13. def addRule(rule: Regex, description: String): RuleFactory.this.type

    Permalink

    Adds a rule to this factory with native types

  14. def addRule(rule: RegexRule): RuleFactory.this.type

    Permalink

    Adds a rule to this factory

  15. def addRules(newRules: Seq[RegexRule]): RuleFactory.this.type

    Permalink

    add multiple rules alltogether

  16. def addSymbolicRule(symbol: String, rule: RegexRule): RuleFactory.this.type

    Permalink

    Adds a rule and its associated symbol to apply some transformation using such symbol

    Adds a rule and its associated symbol to apply some transformation using such symbol

    symbol

    symbol is a character to be used in a transformation application, where many rules can apply different transformations

    rule

    rule to be used when replacing a match with a symbol

  17. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  18. def clearRules(): RuleFactory.this.type

    Permalink
  19. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  22. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def findMatch(text: String): Seq[RuleMatch]

    Permalink

    Applies factory match strategy to find matches and returns any number of Matches

  24. def findMatchFirstOnly(text: String): Option[RuleMatch]

    Permalink

    Specifically finds a first match within a group of matches

  25. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  26. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. def setRules(newRules: Seq[RegexRule]): RuleFactory.this.type

    Permalink

    overrides rules with a new set of rules

  32. def symbolRecovery: Map[String, String]

    Permalink
    Definition Classes
    RuleSymbols
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  35. def transformWithSymbol(symbol: String, text: String): String

    Permalink

    Applies factory transform of all ordered rules utilizing transform and match strategies with provided symbol

    Applies factory transform of all ordered rules utilizing transform and match strategies with provided symbol

    symbol

    a symbol to use for all transformations altogether

    text

    target text to transform

  36. def transformWithSymbolicRules(text: String): String

    Permalink

    Applies factory transform of all ordered rules utilizing transform and match strategies corresponding each rule with its symbol

    Applies factory transform of all ordered rules utilizing transform and match strategies corresponding each rule with its symbol

    text

    target text to transform

    returns

    Returns a transformed text

  37. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from RuleSymbols

Inherited from AnyRef

Inherited from Any

Ungrouped