Analysis Formatter#

Application ID eot_analysis_formatter

Application Aliases analysis-formatter.app formatter.app eot/formatter.app eot/analysis-formatter.app

Description#

The Analysis Formatter application is used to define a custom format for the results of a document analysis.

Configuration#

The configuration is an object defined as (bold = required, italic = optional):

  • formatter (object[string:string]) – A dictionary describing the custom format of the analysis. The first string is the name of the key in your custom result object. The second is one of the strings from the pre-defined set of keywords for the available data

Pre-defined Keywords#

The following keywords can be used within the custom format:

  • uri: URI of the concept

  • canonical: canonical for of the concept if any otherwise it will return the literal

  • literal: literal representation of the concept

  • stem: stem representation of the concept

  • attributes: attributes attach to the concept

  • begin_offset: begin offset in the text

  • end_offset: end offset in the text

  • begin_byte_offset: begin byte offset in the utf-8 input

  • end_byte_offset: end byte offset in the utf-8 input

Example#

In this example we just want to get back the ‘uri’ , ‘begin_offset’ and ‘stem’

wow -p 'english,entity,analysis-formatter(formatter={"uri":"uri","bo":"begin_offset","s":"stem"}).app' \
    -i "John Smith work for EyeOnText."

which yields:

eot_analysis#
[
    {
        "uri": "Person",
        "bo": 0,
        "s": "John Smith"
    },
    {
        "uri": "PersonGiv",
        "bo": 0,
        "s": "John"
    },
    {
        "uri": "GivenName",
        "bo": 0,
        "s": "John"
    },
    {
        "uri": "PersonFam",
        "bo": 5,
        "s": "Smith"
    },
    {
        "uri": "Company",
        "bo": 20,
        "s": "EyeOnText"
    }
]