Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For option 2, 3, 4 and 5 we use the method of a Python Slice.

Anchor
slice
slice
They require a specified start and stop value to be defined. Start and stop can be integers, to define an index, or floats to define a percentage of a slice. Start and stop need to have the same type.

...

Note

IMPORTANT: Regex is quite a bit more efficient than the and/or operators. Try to use regexes as much as possible.

Info

Note that when using different operators the where_to_search will be passed down. If on a lower level one is found, that one will be used.

This way you can:

  • Specify a granularity that applies to different and/or rules

  • Limit the search space for different and/or rules without having to define the where_to_search multiple times

Tag example

Code Block

Extraction example

Code Block

Document type example

Code Block
{
  "type": "document_type",            
  "rules": [
          {
              "gen_id": "Bat&BallHotel",
              "confidence": 100,
              "rule_type": ["first"],
              "+and": [
                  {"+rule": ["L:(?i)The Bat & Ball Hotel"]},
                  {"+rule": ["L:(?i)Order"]}
              ]
          }
      ]
  }

FAQ

Expand
titleHow can I only look in the email subject for my regex?

By adding the option where_to_search::search_in to your rule. An example field would look like this:

Code Block
languagejson
"rules": [
  {
      "confidence": 97,                     
      "+rule": ["L:noreply@contract.fit"]     
      "where_to_search":
        {
          "search_in": ["email_subject"]
        }
  }
]

...