Tinderbox v9 Icon

Tagger file syntax

This information applies both to user-created taggers and customisation of built-in taggers.

Each line of a tagger note's $Text describes one possible 'tag' (i.e. term to be added) followed by one or more 'term't is term terms that are being searched for in $Text by the tagger process.

The general syntax is

tag: term 1; term 2; term 3; 

The first term is the 'tag' separated by a colon from the trigger 'term(s)'. Each discrete term is delimited from others by a semi-colon (in the convention of Tinderbox list delimiters) but unlike other lists in Tinderbox, there must be a semi-colon after the last item: if a terminating semi-colon is omitted the last listed term may not get evaluated (without any error waring).

White space. Space after colons and before/after semicolons is ignored. The layouts below are thus functionally equivalent:

tag:termX;termY;termZ; 

tag: termX; termY; termZ; 

Shorthand definition method. If the only term defined matches the tag, as in:

Eastgate:Eastgate; 

…then a shorthand form may be used, i.e. just the word, alone, on a single line (note no line terminator colon/semicolon is used):

Eastgate 

Tags should be single word. Although a multi-word ('price-sensitive') or multiple word ('price sensitive') tags can be defined they are not recommended/supported. Tags should thus be defined as a single word.

Terms and multiple words. Unlike a tag, a term may be a multi-word string (e.g. 'first-name last-name'). Note, however, that this style of term is not intended for matching long texts (there is no fixed limit, just use multi-word terms sparingly)

Definition ending markers. Lines forming tag definitions must end with a semi-colon. The latter does not apply to comment lines (code comments are described below).

Line wrap. Although the tagger file's $Text may wrap in the text pane, a single definition runs from the start of a line to the first line break encountered regardless of soft wrapping.

Line breaks line break character is treated a a break between tag definition (noting the need to mark the end of definition string (above).

Blank lines. Any blank lines in the tagger note are ignored so may be used to separate the definition strings for clarity of reading.

Comments in taggers. Any line starting with a hash (#) symbol is treated as a comment and is not evaluated for tags/terms.

Summary

The format is thus 'tag:term1;term2;etc…' or simply 'tag'. Note the short form uses no end marker but must be followed by a line break.

Therefore, if the NLTags tagger file contains the line:

Eastgate:Eastgate;Tinderbox;Storyspace;Mark Bernstein; 

… then $NLTags will add the tag "Eastgate" if the text or title of the note mentions any one or more of the words "Eastgate", "Tinderbox", "Storyspace", or "Mark Bernstein".

Thus each discrete tag configuration forms a single line, i.e. line through to the first following line break character. Note that lines with tag definitions must end with a semi-colon.

Each tagger note can define one or more discrete 'tags'—values to add to/remove from the associated Set-type attribute if matched, one tag per line. In turn, each tag may be defined by a semicolon-delimited/terminated list of one or or more 'terms'.