@Abstract (Formula Language)

Abbreviates the contents of one or more fields by:

  • Selecting the most significant words in a body of text
  • Abbreviating common words
  • Dropping vowels from words
  • Removing unnecessary text or characters, such as mail headers or white space
Note: This function removes all carriage returns and linefeeds, regardless of which keywords are selected.

This function only works with single-byte character sets.

Syntax

@Abstract( [ keywords ] ; size ; beginText ; bodyFields )

Parameters

[ keywords ]

Any number of keywords that tell Notes/Domino how you want to abbreviate and sort the text (see list). Keywords are executed in the order in which you list them. Enclose each keyword in brackets and separate multiple commands with colons: [DROPVOWELS]:[NOTRIMWHITE]:[ABBREV].

size

Number. The maximum size of the abstracted text. Can be no larger than 64,994 bytes. The number of bytes available for the abstracted text is size - 1; one byte is reserved for internal use.

beginText

Text. A comment to insert at the beginning of the returned text, no larger than 10 characters. The size of beginText counts toward the total size of the abstracted text, but its contents are unaffected by @Abstract commands. Specify an empty string ("") if you do not want a comment.

bodyFields

Text or text list. Any number of fields containing the text to abstract. May be text, rich text, or keyword fields. The text within each field is concatenated with spaces in the order specified. If Notes/Domino cannot locate a field by name, it uses the string literal instead. Enclose each field name in quotes and separate multiple names with colons: "Sales":"Figures".

CAUTION: Rich text fields are not part of a document until saved. If you want @Abstract to work on additions and changes to the current document, you must first save and then recalculate the document. @Abstract cannot convert rich text to text in a view column.

Return value

abstractedText

Text. The text contained in each of the body fields, abbreviated and sorted as specified by the commands.

Keywords

You can use the following keywords with @Abstract:

[TEXTONLY]

Removes mail headers and punctuation chunks from the text.

[COUNTWORDS]

Computes the significance of each word in the text. A word's significance depends on the number of times it appears in the text. A word that appears in the Significant Word file (see "Files") gets its significance boosted. A word that appears in the Insignificant Word file (see "Files") has no significance.

[SAVE]

Saves the text in its current state. Saved text can be restored with the [RESTORE] keyword.

[RESTORE]

Discards the current text and restores the last-saved text. You can only restore saved text one time. If no text has been previously saved, this keyword has no effect.

[TRYFIT]

Takes the current text and determines if it has become small enough to fit in the specified size. If so, @Abstract returns the current text, with the modifications applied to this point, and stops, ignoring any remaining commands. If not, @Abstract continues with the next keyword.

[SORTCHUNKS]

Sorts the text according to significance. The text is divided into chunks, of which there are three types: text, mail header, and punctuation.

  • Text chunks are usually sentences. They may be at the beginning, end, or middle of a paragraph.
  • Mail header chunks are created according to the contents of the Mail Headers file (see "Files").
  • Punctuation chunks consist of any text with no letters or digits.

The significance of a chunk depends upon the significances of the words within it, the number of words in the chunk, and the type and position of the chunk. To use [SORTCHUNKS], you must also use [COUNTWORDS].

[ABBREV]

Abbreviates the text. @Abstract uses an Abbreviation Dictionary to substitute abbreviations for words in the text (see "Files"). You can control other aspects of the abbreviation process with the following commands (which have no effect unless followed by the [ABBREV] keyword):

[USEDICT]

Specifies that the Abbreviation Dictionary should be used. This is the default.

[NODICT]

Specifies that the Abbreviation Dictionary should not be used.

[KEEPVOWELS]

Keeps vowels in words. This is the default.

[DROPVOWELS]

Removes vowels from words. The first vowel in a word that begins with a vowel isn't affected. If you use [DROPVOWELS], you can optionally use one of the following subcommands.

[DROPFIRSTVOWEL]

Drops vowels from the beginning of words.

[KEEPFIRSTVOWEL]

Keeps vowels at the beginning of words. This is the default.

[TRIMWHITE]

Removes extra white space characters from the text. This is the default.

[NOTRIMWHITE]

Retains extra white space characters in the text.

[TRIMPUNCT]

Removes extra white space characters surrounding punctuation.

[NOTRIMPUNCT]

Retains extra white space characters surrounding punctuation.

[NOSTOPLIST]

Disables the insignificant word list (notestop.txt)

[NOSIGLIST]

Disables the significant word list (notesigl.txt).

Rules

There are three built-in programs you can use with @Abstract.

[RULE1] consists of the following commands, executed in this order:

[TEXTONLY]:[TRYFIT]

Removes all mail header and punctuation chunks. If the text fits, the function is done; otherwise, continues.

[TRIMPUNCT]:

Trims white space around punctuation marks.

[SAVE]:

Saves the current state of the text.

[ABBREV]:[TRYFIT]:

Abbreviates the text. If the text fits, the function is done; otherwise, continues.

[RESTORE]:

Restores the state of the text to what it was prior to abbreviating.

[SAVE]:

Saves the current state of the text.

[DROPVOWELS]:[ABBREV]:[TRYFIT]:

Abbreviates text by dropping vowels. If the text fits, the function is done; otherwise, continues.

[RESTORE]:

Restores the state of the text to what it was prior to abbreviating.

[COUNTWORDS]:[SORTCHUNKS]:[ABBREV]

Counts words and sorts the chunks. Abbreviates the text and returns it.

If the removal of mail headers and punctuation allowed the text to fit into the desired size, then text is returned as is. If the first abbreviation was enough to make the text fit, the returned text begins with a minus character ( - ). If the second abbreviation was enough to make the text fit, the returned text begins with a plus character ( + ). If the function counted the words and sorted the chunks, the text will start with an asterisk ( * ) and the sentences will be separated with a ( | ) to indicate that they were rearranged.

[RULE2] issues the following commands:

[TRIMPUNCT]:[ABBREV]

[RULE3] issues the following commands:

[TEXTONLY]:[TRYFIT]:

Removes all mail header and punctuation chunks. If the text fits, the function is done; otherwise, continue.

[TRIMPUNCT]:

Trims white space around punctuation marks.

[SAVE]:

Saves the current state of the text.

[ABBREV]:[TRYFIT]:

Abbreviates the text. If the text fits, the function is done; otherwise, continue.

[RESTORE]:

Restores the state of the text to what it was prior to abbreviating.

[DROPVOWELS]:

Abbreviates text by dropping vowels.

[SAVE]:

Saves the current state of the text.

[ABBREV]:[TRYFIT]:

If the text fits, the function is done; otherwise, continue.

[RESTORE]:

Restores the state of the text to what it was prior to abbreviating.

[COUNTWORDS]:[SORTCHUNKS]:[ABBREV]

Counts words and sorts the chunks. Abbreviates the text and returns it.

If the function counted the words and sorted the chunks, the returned text begins with an asterisk ( * ) and the sentences are separated with a ( | ) to indicate that they were rearranged.

Files

The following files are used by @Abstract. You can create all, some, or none of these text files, depending on how you want to use @Abstract. Any files you do create must be named as specified and be present in your Notes/Data file path when you start running the software.

Abbreviation Dictionary (noteabbr.txt)

Each line of the file should contain two words: the first is the original word and the second is its abbreviation. An abbreviation must be shorter than the word it replaces. For example:

telephone ph
number no

Capitalization works as follows:

  • If the abbreviation is specified in uppercase letters, then it always appears in uppercase letters.
  • If the original word appears in lowercase letters, the abbreviation appears as specified in the abbreviation dictionary.
  • If the original word appears in uppercase letters or in a mixture of uppercase and lowercase letters, the abbreviation appears in uppercase letters.
  • A lowercase first letter in the abbreviation will be converted to uppercase if needed to match the first letter in the original word.
  • The remaining letters in the abbreviation will be converted to uppercase if needed to match the case of the original word's second letter.

The abbreviation is never converted to lowercase, but it may be converted to uppercase.

Specified abbreviation

Word being replaced

Resulting abbreviation

Reasoning

Phone

telephone

Phone

The original word appears in lowercase, so the specified abbreviation's case is used.

Phone

TElephone

PHONE

The abbreviation's case is based upon the original word's case.

Phone

Telephone

Phone

The abbreviation's case is based upon the original word's case.

PHONE

Telephone

PHONE

The abbreviation is specified as uppercase, so it always appears as uppercase.

Phone

tElephone

PHONE

The first letter of the abbreviation was already uppercase, so Notes/Domino leaves it alone. The remaining letters of the abbreviation are converted to uppercase to match the second letter of the original word.

Significant Words (notesigl.txt)

The file should be a free-form list of significant words, such as "urgent" or "immediately." When @Abstract computes the significance of text, it boosts the significance of any words included in the significant word list. For example:


client


boss


chocolate

Insignificant Words (notestop.txt)

The file should be a free-form list of words that are always insignificant, such as "the," "and," and "of." When @Abstract computes the significance of words, it ignores any words included in this file. For example:


the


and


of

Mail Headers (notehead.txt)

The file should be a free-form list of words that indicate mail headers, such as Subject, From, and To. In order for @Abstract to consider a chunk a mail header, it must begin with one of the words specified in this file and be followed immediately by a colon and a space. If you want a mail header to be considered significant, place an asterisk after the word. For example:


Subject*


From

Examples

  1. This formula abbreviates the contents of the description field by eliminating vowels.
    @Abstract( [DROPVOWELS]:[ABBREV]; 200; ""; "description" )

    If the description field contained this text: The kickoff meeting for our capital campaign is tomorrow.

    Then the formula returns: Th kckff mtng fr r cptl cmpgn is tmrrw.

  2. This formula abbreviates the contents of the description field by using an Abbreviation Dictionary and eliminating vowels, including the vowels that appear as the first letter in a word.
    @Abstract([USEDICT]:[DROPVOWELS]:[DROPFIRSTVOWEL]:[ABBREV]; 200; ""; "description" )

    If the Abbreviation Dictionary contains the following:

    capital cap meeting mtg tomorrow tom

    Then the formula returns:Th kckff mtg fr r cap cmpgn s tom.

  3. This formula shows a misunderstanding in the use of @Abstract. It returns the contents of the description field unaltered, since the [ABBREV] keyword incorrectly precedes [DROPVOWELS].
    @Abstract( [ABBREV]:[DROPVOWELS]; 200; ""; "description" )
  4. This formula removes the white spaces from around all punctuation and abbreviates the text in the "opinion" field according to the noteabbr.txt file, which contains the following:

    following flwg punctuation punc

    @Abstract([RULE2];300;"Result:";"opinion")

    If the opinion field contains the text: The FOllowing is a list of punctuation marks: ! , ; :.

    Then the formula returns: Result:The FLWG is a list of punc marks:!<;:.