{"componentChunkName":"component---node-modules-carrotsearch-gatsby-theme-apidocs-templates-documentation-page-js","path":"/dictionaries/","result":{"data":{"html":{"frontmatter":{"id":"dictionaries","title":"Dictionaries"},"html":"<article>\n  <h1>Dictionaries</h1>\n\n  <p id=\"d2a67b1b\">\n    Lingo3G uses dictionaries to improve the quality of clustering for a\n    specific language. This section introduces the available dictionaries and\n    the common syntax of dictionary entries.\n  </p>\n\n  <section id=\"types-of-dictionaries\">\n    <h2>\n        <a class=\"anchor\" href=\"#types-of-dictionaries\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Types of dictionaries\n      </h2>\n\n    <p id=\"types-of-dictionaries:6355bc12\">Lingo3G supports the following dictionaries:</p>\n\n    <dl>\n      <dt>Label dictionary</dt>\n      <dd>\n        <p id=\"types-of-dictionaries:d926979c\">\n          Controls the labels Lingo3G chooses to describe clusters. You can use\n          the label dictionary to remove certain labels, such as domain-common\n          phrases or abusive language. You can also use the label dictionary to\n          promote other labels, such as product or brand names.\n        </p>\n      </dd>\n\n      <dt>Synonym dictionary</dt>\n      <dd>\n        <p id=\"types-of-dictionaries:f0d81f70\">\n          Defines words and phrases that represent the same concept, such as\n          <em>photo</em> and <em>picture</em> to let Lingo3G know to put\n          documents containing synonymous words or phrases in the same cluster.\n        </p>\n      </dd>\n\n      <dt>Tag dictionary</dt>\n      <dd>\n        <p id=\"types-of-dictionaries:eb0d30e5\">\n          Categorizes individual words based on their grammatical or semantic\n          function, such as preposition, verb or proper name. You can reference\n          the categories in the label dictionary to, for example, remove labels\n          ending in a preposition, such as <em>information about</em>.\n        </p>\n      </dd>\n    </dl>\n  </section>\n\n  <section id=\"scopes-of-dictionaries\">\n    <h2>\n        <a class=\"anchor\" href=\"#scopes-of-dictionaries\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Scopes of dictionaries\n      </h2>\n\n    <p id=\"scopes-of-dictionaries:fffd6c8b\">\n      Lingo3G applies dictionaries of all types in two complementary scopes:\n    </p>\n\n    <dl>\n      <dt id=\"scopes-of-dictionaries:global\">Global</dt>\n      <dd>\n        <p id=\"scopes-of-dictionaries:2d420a02\">\n          Global dictionaries apply to all clustering requests. Lingo3G ships\n          with basic global dictionaries suitable for most types of documents.\n        </p>\n\n        <p id=\"scopes-of-dictionaries:3f9e1047\">\n          In typical use cases, the global dictionaries are static –\n          Lingo3G <a href=\"#location-of-dictionary-files\">loads</a> them once on\n          startup and reuses for all clustering requests.\n        </p>\n      </dd>\n\n      <dt id=\"scopes-of-dictionaries:per-request\">Per-request</dt>\n      <dd>\n        <p id=\"scopes-of-dictionaries:41cfc373\">\n          Per-request dictionaries apply for a specific clustering request in\n          addition to the global dictionaries. You can use per-request\n          dictionaries to extend global dictionaries with temporary entries\n          provided by end-end users at runtime.\n        </p>\n\n        <p id=\"scopes-of-dictionaries:b8b3cf4f\">\n          Lingo3G supports per-request dictionaries both in the\n          <a href=\"/rest-api-dictionaries/#per-request-dictionaries\">REST API</a>\n          and in the\n          <a href=\"/java-dictionaries/#ephemeral-dictionaries\">Java API</a>.\n        </p>\n      </dd>\n    </dl>\n  </section>\n\n  <section id=\"location-of-dictionary-files\">\n    <h2>\n        <a class=\"anchor\" href=\"#location-of-dictionary-files\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Location of dictionary files\n      </h2>\n\n    <section id=\"location-of-dictionary-files:document-clustering-server\">\n      <h3>\n        <a class=\"anchor\" href=\"#location-of-dictionary-files:document-clustering-server\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Document Clustering Server\n      </h3>\n\n      <p id=\"location-of-dictionary-files:document-clustering-server:e387ddd0\">\n        The Document Clustering Server (REST API) reads dictionary files from\n        the <code>web/service/resources</code> directory in the server's\n        distribution directory. After you edit some of the files, restart the\n        Document Clustering Server for the changes to take effect.\n      </p>\n    </section>\n\n    <section id=\"location-of-dictionary-files:java-api\">\n      <h3>\n        <a class=\"anchor\" href=\"#location-of-dictionary-files:java-api\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Java API\n      </h3>\n\n      <p id=\"location-of-dictionary-files:java-api:8e9dacfe\">\n        By default, Lingo3G Java API tries to read dictionaries from the JAR\n        file from which the supplier of its corresponding\n        <code>LanguageComponents</code> implementation comes from. The following\n        table lists the locations of dictionary files for specific languages,\n        including the name of the JAR file and path within the JAR.\n      </p>\n\n      <figure id=\"dictionaries:source-jar\" class=\"dictionaries\">\n        <table>\n          <thead>\n            <tr>\n              <th>Language</th>\n              <th>JAR file</th>\n              <th>JAR path</th>\n            </tr>\n          </thead>\n          <tbody>\n            <tr>\n              <td>English</td>\n              <td>\n                <code style=\"white-space: pre\">lingo3g-2.0.0.jar</code>\n              </td>\n              <td><code>/</code></td>\n            </tr>\n            <tr>\n              <td>Dutch</td>\n              <td>\n                <code style=\"white-space: pre\">lingo3g-lang-dutch-2.0.0.jar</code>\n              </td>\n              <td><code>/</code></td>\n            </tr>\n            <tr>\n              <td>Polish</td>\n              <td>\n                <code style=\"white-space: pre\">lingo3g-lang-polish-2.0.0.jar</code>\n              </td>\n              <td><code>/</code></td>\n            </tr>\n            <tr>\n              <td>\n                Danish, Finnish, French, German, Hungarian, Italian, Norwegian,\n                Portuguese, Romanian, Russian, Spanish, Swedish, Turkish\n              </td>\n              <td>\n                <code style=\"white-space: pre\">lingo3g-lang-carrot2-2.0.0.jar</code>\n              </td>\n              <td><code>/</code></td>\n            </tr>\n            <tr>\n              <td>\n                Arabic, Armenian, Bulgarian, Croatian, Czech, Estonian,\n                Galician, Greek, Hindi, Indonesian, Irish, Latvian, Lithuanian,\n                Thai\n              </td>\n              <td>\n                <code style=\"white-space: pre\">lingo3g-lang-lucene-2.0.0.jar</code>\n              </td>\n              <td><code>/</code></td>\n            </tr>\n            <tr>\n              <td>Chinese simplified, Chinese traditional, Japanese, Korean</td>\n              <td>\n                <code style=\"white-space: pre\">lingo3g-lang-lucene-cjk-2.0.0.jar</code>\n              </td>\n              <td><code>/</code></td>\n            </tr>\n          </tbody>\n        </table>\n        <figcaption>\n          <p>\n            Location of dictionary files in the standard Lingo3G distribution.\n          </p>\n        </figcaption>\n      </figure>\n\n      <div class=\"warning\" id=\"location-of-dictionary-files:java-api:9d80c010\">\n        <strong>Heads up, don't edit dictionaries inside JARs!</strong>\n\n        <p id=\"location-of-dictionary-files:java-api:1b526121\">\n          If you use Lingo3G Java API, don't modify the default dictionaries\n          in-place. Instead, copy the relevant dictionaries to your\n          application-specific location and\n          <a href=\"/java-dictionaries/#customizing-dictionaries\">load them from that location</a>.\n        </p>\n      </div>\n    </section>\n  </section>\n\n  <section id=\"label-matchers\">\n    <h2>\n        <a class=\"anchor\" href=\"#label-matchers\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Label matchers\n      </h2>\n\n    <p id=\"label-matchers:834af9dc\">\n      Label and synonym dictionaries use a common syntax based on\n      <strong>label matcher</strong> entries. A matcher entry describes how\n      Lingo3G decides whether to apply the dictionary-specific action to the\n      specific word or phrase. For label dictionaries the action is removing or\n      promoting the matching label. For synonym dictionaries, the action is\n      including the matching label in the synonym set.\n    </p>\n\n    <p id=\"label-matchers:c6995252\">The following excerpt shows the available label matchers.</p>\n\n    <figure id=\"label-matchers:example\">\n      <div class=\"gatsby-highlight\">\n    <pre class=\"language-json\"><code data-language=\"json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"exact\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token string\">\"Literal case-sensitive match\"</span>\n  <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"glob\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token string\">\"starts with phrase *\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token string\">\"* contains words *\"</span>\n  <span class=\"token punctuation\">]</span><span class=\"token punctuation\">,</span>\n  <span class=\"token property\">\"regexp\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token string\">\"(?).+BadLabel.+\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token string\">\"(?)^[0-9]\\\\s*.*\"</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre>\n  </div>\n      <figcaption>\n        <p>An example of three different label matcher types.</p>\n      </figcaption>\n    </figure>\n\n    <p id=\"label-matchers:d41d8cd9\"></p>\n\n    <p id=\"label-matchers:4baff9f2\">\n      The <code>exact</code>, <code>glob</code> and\n      <code>regexp</code> properties are optional and can contain an array of\n      string entries for the specific matcher types, described in the following\n      sections. If a word or a label matches <em>any</em> matcher of any type,\n      Lingo3G applies the dictionary-specific action to the matching label.\n    </p>\n\n    <section id=\"label-matchers:exact\">\n      <h3>\n        <a class=\"anchor\" href=\"#label-matchers:exact\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Exact matcher\n      </h3>\n\n      <p id=\"label-matchers:exact:72656ad7\">\n        Exact matchers require <strong>exact, case-sensitive</strong> equality\n        between the word or phrase and the dictionary entry. Exact matcher\n        entries are fast to parse and very fast to apply during clustering.\n      </p>\n\n      <figure id=\"label-matchers:exact:example\">\n        <div class=\"gatsby-highlight\">\n    <pre class=\"language-json\"><code data-language=\"json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"exact\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token string\">\"DevOps\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token string\">\"Windows 2000\"</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre>\n  </div>\n        <figcaption>\n          <p>\n            An example label dictionary with two\n            <code>exact</code> matcher entries.\n          </p>\n        </figcaption>\n      </figure>\n\n      <p id=\"label-matchers:exact:7c37be49\">\n        The above label dictionary definitions match labels\n        <em>DevOps</em> and <em>Windows 2000</em>, but does not match\n        <em>Devops</em> or <em>Windows 2000 machine</em>.\n      </p>\n\n      <p id=\"label-matchers:exact:f34d5963\">\n        For case-insensitive matching, use\n        <a href=\"#label-matchers:glob\">glob matchers</a> (preferably) or\n        case-insensitive\n        <a href=\"#label-matchers:regexp\">regular expression matchers</a>.\n      </p>\n    </section>\n\n    <section id=\"label-matchers:glob\">\n      <h3>\n        <a class=\"anchor\" href=\"#label-matchers:glob\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Glob matcher\n      </h3>\n\n      <p id=\"label-matchers:glob:9e52e3a0\">\n        Glob matcher allows simple word-based wildcard matching. The primary use\n        case of the glob matcher is case-insensitive matching of literal\n        phrases, as well as \"begins with…\", \"ends with…\" or\n        \"contains…\" types of expressions. Glob matcher entries are fast\n        to parse and very fast to apply.\n      </p>\n\n      <figure id=\"label-matchers:glob:example\">\n        <div class=\"gatsby-highlight\">\n    <pre class=\"language-json\"><code data-language=\"json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"glob\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token string\">\"more information\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token string\">\"more information *\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token string\">\"* about *\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token string\">\"big ?\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token string\">\"+ apple\"</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre>\n  </div>\n        <figcaption>\n          <p>\n            An example label dictionary with <code>glob</code> matcher entries.\n          </p>\n        </figcaption>\n      </figure>\n\n      <section id=\"label-matchers:glob:rules\">\n        <h4>\n        <a class=\"anchor\" href=\"#label-matchers:glob:rules\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Matching rules\n      </h4>\n\n        <ul>\n          <li>\n            <p id=\"label-matchers:glob:rules:04e647c0\">\n              Each entry must consist of one or more space-separated tokens.\n            </p>\n          </li>\n\n          <li>\n            <p id=\"label-matchers:glob:rules:37e132b9\">\n              A token is a sequence of arbitrary characters, such as words,\n              numbers, identifiers.\n            </p>\n          </li>\n\n          <li>\n            <p id=\"label-matchers:glob:rules:2faae665\">\n              Matching of unquoted tokens is case-, accent- and\n              grammatical-form-insensitive.\n            </p>\n          </li>\n\n          <li>\n            <p id=\"label-matchers:glob:rules:1d5f389e\">\n              Matching of quoted tokens is literal: case- and\n              grammatical-form-sensitive.\n            </p>\n\n            <p id=\"label-matchers:glob:rules:224c76d6\">\n              For example, <code>\"Rating***\"</code> matches only the\n              <em>Rating***</em> string, exactly comparing the case, grammatical\n              form and occurrences of special characters. Glob matcher allows\n              the <code>*</code> character in quoted tokens and matches them\n              literally, not as a wildcard.\n            </p>\n          </li>\n\n          <li>\n            <p id=\"label-matchers:glob:rules:c3d59a05\">\n              To include quote characters in the token, escape them with the\n              <code>\\</code> character, for example:\n              <code>\\\"information\\\"</code>.\n            </p>\n          </li>\n\n          <li>\n            <p id=\"label-matchers:glob:rules:5332aeb9\">\n              Glob matcher recognizes the following wildcard-matching tokens:\n            </p>\n\n            <ul>\n              <li>\n                <p id=\"label-matchers:glob:rules:8e8ad42e\"><code>?</code> matches exactly one (any) word.</p>\n              </li>\n              <li>\n                <p id=\"label-matchers:glob:rules:8a009ce2\"><code>*</code> matches zero or more words.</p>\n              </li>\n              <li>\n                <p id=\"label-matchers:glob:rules:0443ffb0\">\n                  <code>+</code> matches one or more words. This token is\n                  functionally equivalent to: <code>? *</code>.\n                </p>\n              </li>\n            </ul>\n\n            <p id=\"label-matchers:glob:rules:e8e38876\">\n              The <code>*</code> and <code>+</code> wildcards are\n              <em>possessive</em> in the regular expression matching sense: they\n              match the <em>maximum</em> sequence of tokens until the next token\n              in the pattern. These wildcards will be suitable in most label\n              matching scenarios.\n              <a href=\"#label-matchers:glob:examples:possessive-match\">In rare cases</a>, you may need to use the reluctant wildcards.\n            </p>\n          </li>\n\n          <li>\n            <p id=\"label-matchers:glob:rules:26429c52\">\n              Glob matcher recognizes the following reluctant wildcard-matching\n              tokens:\n            </p>\n\n            <ul>\n              <li>\n                <p id=\"label-matchers:glob:rules:c4e38a30\"><code>*?</code> matches zero or more words (reluctant).</p>\n              </li>\n\n              <li>\n                <p id=\"label-matchers:glob:rules:2b1e7989\">\n                  <code>+?</code> matches one or more words (reluctant). This\n                  token is functionally equivalent to: <code>? *?</code>.\n                </p>\n              </li>\n            </ul>\n\n            <p id=\"label-matchers:glob:rules:3c3df4f0\">\n              The reluctant wildcards match the <em>minimal</em> sequence of\n              tokens until the next token in the pattern.\n            </p>\n          </li>\n\n          <li>\n            <p id=\"label-matchers:glob:rules:da5cbdd2\">Glob matcher recognizes the following word category tokens:</p>\n\n            <ul>\n              <li id=\"label-matchers:glob:rules:a3ce061a\">\n                <code>{fnc}</code>: matches a function word (<em>about</em>,\n                <em>have</em>)\n              </li>\n              <li id=\"label-matchers:glob:rules:5ec71dbc\">\n                <code>{verb}</code>: matches a verb (<em>have</em>,\n                <em>allows</em>)\n              </li>\n              <li id=\"label-matchers:glob:rules:173ef892\">\n                <code>{noun}</code>: matches a noun (<em>website</em>,\n                <em>test</em>)\n              </li>\n              <li id=\"label-matchers:glob:rules:e4cbba4d\"><code>{adj}</code>: matches an adjective (<em>cool</em>)</li>\n              <li id=\"label-matchers:glob:rules:b37e2a7b\"><code>{adv}</code>: matches an adverb (<em>fully</em>)</li>\n              <li id=\"label-matchers:glob:rules:3d0442f8\">\n                <code>{geo}</code>: matches a geographical reference\n                (<em>London</em>)\n              </li>\n              <li id=\"label-matchers:glob:rules:c7a77618\">\n                <code>{name}</code>: matches a proper noun (<em>John</em>)\n              </li>\n              <li id=\"label-matchers:glob:rules:2fbb1355\">\n                <code>numeric</code>: matches numeric values (<em>10.4</em>,\n                <em>2021</em>, <em>14:30</em>, <em>3/4</em>)\n              </li>\n            </ul>\n\n            <p id=\"label-matchers:glob:rules:4ac1404c\">\n              The specific set of words each category token will match depends\n              on the language in which you perform clustering and on the\n              contents of the\n              <a href=\"/tag-dictionary/\">tag dictionaries</a>. Note that\n              category-based matching may be\n              <a href=\"#label-matchers:glob:examples:incorrect-word-tag-match\">incorrect for some inputs</a>\n              due to the simplicity of Lingo3G's word tagger.\n            </p>\n          </li>\n\n          <li>\n            <p id=\"label-matchers:glob:rules:9a93269b\">\n              Glob matcher imposes the following restrictions on wildcard\n              operators:\n            </p>\n\n            <ul>\n              <li>\n                <p id=\"label-matchers:glob:rules:04f3112f\">\n                  You cannot use wildcards (<code>*</code>, <code>+</code>) to\n                  express string prefixes or suffixes. For example,\n                  <code>programm*</code>, is not supported.\n                </p>\n              </li>\n\n              <li>\n                <p id=\"label-matchers:glob:rules:5a13b672\">Glob matcher does not support greedy operators.</p>\n              </li>\n            </ul>\n          </li>\n        </ul>\n\n        <div class=\"warning\" id=\"label-matchers:glob:rules:db2b2740\">\n          <strong>Heads up, normalization of unquoted tokens!</strong>\n\n          <p id=\"label-matchers:glob:rules:51f4bdc1\">\n            Glob matcher normalizes the case, accents and grammatical form of\n            unquoted tokens before trying to match them against labels. For\n            example, under default settings and the English language, the token\n            <code>naïve</code> matches, among others, the following labels:\n            <em>naïve</em>, <em>naive</em>, <em>naïvely</em> or\n            <em>NAIVELY</em>.\n          </p>\n\n          <p id=\"label-matchers:glob:rules:b84dc9b7\">\n            Glob matcher normalizes character case based on the\n            <code>ROOT</code> Java locale, which performs language-neutral case\n            conflation according to Unicode rules.\n          </p>\n\n          <p id=\"label-matchers:glob:rules:85344049\">\n            Grammatical form and accent normalization depends on the related\n            Lingo3G parameters:\n            <a href=\"/lingo3g-parameters/#documents.useHeuristicStemming\">useHeuristicStemming</a>,\n            <a href=\"/lingo3g-parameters/#documents.useBuiltInWordDatabaseForStemming\">useBuiltInWordDatabaseForStemming</a>\n            and\n            <a href=\"/lingo3g-parameters/#documents.accentFolding\">accentFolding</a>. By default, both grammatical form and accent normalization is\n            enabled.\n          </p>\n        </div>\n      </section>\n\n      <section id=\"label-matchers:glob:examples\">\n        <h4>\n        <a class=\"anchor\" href=\"#label-matchers:glob:examples\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Example entries\n      </h4>\n\n        <p id=\"label-matchers:glob:examples:d921a8cc\">\n          The following table shows a number of example glob entries. The\n          \"Non-matching strings\" column also has an explanation why there is no\n          match.\n        </p>\n\n        <p id=\"label-matchers:glob:examples:92b99858\">\n          All examples assume that the processing language is English and that\n          normalization of grammatical forms and accents is enabled, which is\n          the Lingo3G default.\n        </p>\n\n        <table class=\"glob-examples\">\n          <thead>\n            <tr>\n              <th>Entry</th>\n              <th style=\"width: 40%\">Matching strings</th>\n              <th style=\"width: 40%\">Non-matching strings</th>\n            </tr>\n          </thead>\n\n          <tbody>\n            <tr>\n              <td><code>more information</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:ab066b32\"><code>More information</code></p>\n                <p id=\"label-matchers:glob:examples:d30f8dc5\"><code>MORE INFORMATION</code></p>\n                <p id=\"label-matchers:glob:examples:aff356a6\">\n                  <code>more informations</code>\n                  <span class=\"explanation\">\n                    <em>informations</em> is a different grammatical form of\n                    <em>information</em>.\n                  </span>\n                </p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:ce135b1e\">\n                  <code>more information about</code>\n                  <span class=\"explanation\">\n                    Pattern does not contain wildcards, only 2-word strings can\n                    match.\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:a77468fe\">\n                  <code>some more information</code>\n                  <span class=\"explanation\">\n                    Pattern does not contain wildcards, only 2-word strings can\n                    match.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>more information *</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:5dc731e4\"><code>more information</code></p>\n                <p id=\"label-matchers:glob:examples:2614416e\"><code>More information about</code></p>\n                <p id=\"label-matchers:glob:examples:81198629\"><code>More information about a</code></p>\n                <p id=\"label-matchers:glob:examples:f8bb6d83\"><code>more informations</code></p>\n                <p id=\"label-matchers:glob:examples:c87f17ee\"><code>more informations about</code></p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:bc9fa2a4\">\n                  <code>some more information</code>\n                  <span class=\"explanation\">\n                    Pattern does not have wildcards at the beginning, matching\n                    strings must start with <em>more information</em>.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>* information *</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:bb3ccd58\"><code>information</code></p>\n                <p id=\"label-matchers:glob:examples:5dc731e4_0\"><code>more information</code></p>\n                <p id=\"label-matchers:glob:examples:a9e1d3d8\"><code>information about</code></p>\n                <p id=\"label-matchers:glob:examples:2d041f7f\"><code>a lot more information on</code></p>\n                <p id=\"label-matchers:glob:examples:16f0ada2\"><code>informations</code></p>\n                <p id=\"label-matchers:glob:examples:c87f17ee_0\"><code>more informations about</code></p>\n                <p id=\"label-matchers:glob:examples:da9c14e9\"><code>some more informations</code></p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:9e753706\">\n                  <code>more info</code>\n                  <span class=\"explanation\">\n                    <em>info</em> is not a different grammatical of\n                    <em>information</em>, so it does not match.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>naïve *</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:d7b4302a\">\n                  <code>naive</code>\n                  <span class=\"explanation\">\n                    <em>naive</em> is an accent-normalized variant of\n                    <em>naïve</em>\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:d05449a7\">\n                  <code>naïvely</code>\n                  <span class=\"explanation\">\n                    <em>naïvely</em> is a different grammatical form of\n                    <em>naïve</em>\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:8330093f\"><code>naive approach</code></p>\n                <p id=\"label-matchers:glob:examples:58625158\"><code>Naively</code></p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:a1590ea1\">\n                  <code>naiive</code>\n                  <span class=\"explanation\">\n                    Accent normalization does not correct spelling errors.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>{fnc}</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:8bf8854b\">\n                  <code>of</code>\n                </p>\n                <p id=\"label-matchers:glob:examples:d5566982\">\n                  <code>for</code>\n                </p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:a205ea31\">\n                  <code>clustering</code>\n                  <span class=\"explanation\">\n                    <em>clustering</em> is not a function word\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>{adj} {noun}</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:bcc583db\">\n                  <code>fast algorithm</code>\n                </p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:1ac293df\">\n                  <code>factorization algorithm</code>\n                  <span class=\"explanation\">\n                    <em>factorization</em> is not an adjective\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr id=\"label-matchers:glob:examples:incorrect-word-tag-match\">\n              <td><code>to {verb} a {noun}</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:incorrect-word-tag-match:6847dec7\">\n                  <code>to visit a hotel</code>\n                </p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:incorrect-word-tag-match:da72ac44\">\n                  <code>to plan a vacation</code>\n                  <span class=\"explanation\">\n                    This string should also match the rule. It doesn't due to\n                    the limitation of Lingo3G word categorization algorithm.\n                    Lingo3G categorizes all occurrences of <em>plan</em> as a\n                    noun, regardless of the context of the word. In this case,\n                    the context implies <em>plan</em> is a verb, but Lingo3G\n                    does not take this into account.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>+ information</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:b3bd2b31\"><code>too much information</code></p>\n                <p id=\"label-matchers:glob:examples:5dc731e4_1\"><code>more information</code></p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:aabfe65f\">\n                  <code>information</code>\n                  <span class=\"explanation\">\n                    <code>+</code> requires at least one word before\n                    <em>information</em>.\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:ea96b65c\">\n                  <code>more information about</code>\n                  <span class=\"explanation\">\n                    <em>about</em> is an extra word not covered by the pattern.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>\"Information\" *</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:a82be0f5\"><code>Information</code></p>\n                <p id=\"label-matchers:glob:examples:2aa615aa\"><code>Information about</code></p>\n                <p id=\"label-matchers:glob:examples:480c8a65\"><code>Information ABOUT</code></p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:568c3655\">\n                  <code>information</code>\n                  <span class=\"explanation\">\n                    The <em>Information</em> token is case-sensitive, it does\n                    not match <em>information</em>.\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:2cdecf9f\">\n                  <code>information about</code>\n                  <span class=\"explanation\">\n                    The <em>Information</em> token is case-sensitive, it does\n                    not match <em>information</em>.\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:64536c0f\">\n                  <code>Informations about</code>\n                  <span class=\"explanation\">\n                    Normalization of grammatical forms does not apply to quoted\n                    tokens, so <em>Informations</em> does not match pattern\n                    token <em>\"Information\"</em>.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>data ?</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:dea0a476\"><code>data mining</code></p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:27d5cfff\">\n                  <code>data</code>\n                  <span class=\"explanation\">\n                    <code>?</code> requires a word after <em>data</em>.\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:c8a2323f\">\n                  <code>data mining research</code>\n                  <span class=\"explanation\">\n                    <code>?</code> matches one word, so <em>research</em>\n                    does not match\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>\"Programm*\"</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:b73b9842\"><code>Programm*</code></p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:fcc75311\">\n                  <code>Programmer</code>\n                  <span class=\"explanation\">\n                    <em>Programm*</em> token is taken literally, it matches only\n                    <em>Programm*</em>.\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:d90df1ff\">\n                  <code>Programming</code>\n                  <span class=\"explanation\">\n                    <em>Programm*</em> token is taken literally, it matches only\n                    <em>Programm*</em>.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>\\\"information\\\"</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:e976bd9f\"><code>\"information\"</code></p>\n                <p id=\"label-matchers:glob:examples:1ee14cbf\">\n                  <code>\"INFOrmation\"</code>\n                  <span class=\"explanation\">\n                    Escaped quotes are taken literally, so match is\n                    case-insensitive\n                  </span>\n                </p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:c137bee9\">\n                  <code>information</code>\n                  <span class=\"explanation\">\n                    Escaped quotes not found in the string being matched.\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:bf314f45\">\n                  <code>\"information</code>\n                  <span class=\"explanation\">\n                    Escaped quotes not found in the string being matched.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr id=\"label-matchers:glob:examples:possessive-match\">\n              <td><code>* protein protein *</code></td>\n              <td colspan=\"2\">\n                <p id=\"label-matchers:glob:examples:possessive-match:d3449dc0\">This pattern will never match any input.</p>\n\n                <p id=\"label-matchers:glob:examples:possessive-match:369910d0\">\n                  The reason for this is that <code>*</code> makes a possessive\n                  match, that is matches the maximum number of words until the\n                  next token in the pattern. Therefore, the first occurrence of\n                  the <code>protein</code> token in the pattern will correspond\n                  to the <em>last</em> occurrence of that word in the input\n                  label, leaving no content to match the second occurrence of\n                  <code>protein</code> in the pattern. As a result, there is no\n                  such sequence that can ever match this a pattern.\n                </p>\n\n                <p id=\"label-matchers:glob:examples:possessive-match:a65888d4\">\n                  To match labels with a doubled occurrence of some word, use\n                  the\n                  <a href=\"#label-matchers:glob:examples:reluctant-match\">reluctant variant</a>\n                  of the wildcard.\n                </p>\n              </td>\n            </tr>\n\n            <tr id=\"label-matchers:glob:examples:reluctant-match\">\n              <td><code>*? protein protein *</code></td>\n              <td>\n                <p id=\"label-matchers:glob:examples:reluctant-match:871fbde5\"><code>protein protein</code></p>\n                <p id=\"label-matchers:glob:examples:reluctant-match:0841f1f8\"><code>selective protein protein interaction</code></p>\n                <p id=\"label-matchers:glob:examples:reluctant-match:2c9a8118\"><code>protein protein protein</code></p>\n              </td>\n              <td>\n                <p id=\"label-matchers:glob:examples:reluctant-match:5c59f740\">\n                  <code>protein</code>\n                  <span class=\"explanation\">\n                    Two occurrences of <em>protein</em> on input are required.\n                  </span>\n                </p>\n                <p id=\"label-matchers:glob:examples:reluctant-match:a492da05\">\n                  <code>selective protein-protein interaction</code>\n                  <span class=\"explanation\">\n                    The \"protein-protein\" string counts as one token and it\n                    therefore does not match the two-token\n                    <em>protein protein</em> part of the pattern.\n                  </span>\n                </p>\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>programm*</code></td>\n              <td colspan=\"2\">\n                Illegal pattern, combinations of the <code>*</code> wildcard and\n                other characters are not supported.\n              </td>\n            </tr>\n\n            <tr>\n              <td><code>\"information</code></td>\n              <td colspan=\"2\">Illegal pattern, unbalanced double quotes.</td>\n            </tr>\n\n            <tr>\n              <td><code>*</code></td>\n              <td colspan=\"2\">\n                Illegal pattern, there must be at least one non-wildcard token.\n              </td>\n            </tr>\n          </tbody>\n        </table>\n      </section>\n    </section>\n\n    <section id=\"label-matchers:regexp\">\n      <h3>\n        <a class=\"anchor\" href=\"#label-matchers:regexp\" aria-hidden=\"true\"><svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"/></svg></a>Regular expression matcher\n      </h3>\n\n      <p id=\"label-matchers:regexp:a45305e4\">\n        The regular expression matcher checks words or labels against a list of\n        regular expressions you provide.\n      </p>\n\n      <figure id=\"label-matchers:regexp:example\">\n        <div class=\"gatsby-highlight\">\n    <pre class=\"language-json\"><code data-language=\"json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"regexp\"</span><span class=\"token operator\">:</span> <span class=\"token punctuation\">[</span>\n    <span class=\"token string\">\"Windows 9[58]\"</span><span class=\"token punctuation\">,</span>\n    <span class=\"token string\">\"(?)^[0-9]\\\\s*.*\"</span>\n  <span class=\"token punctuation\">]</span>\n<span class=\"token punctuation\">}</span></code></pre>\n  </div>\n        <figcaption>\n          <p>\n            An example label dictionary with two\n            <code>regexp</code> matcher entries.\n          </p>\n        </figcaption>\n      </figure>\n\n      <p id=\"label-matchers:regexp:86c21864\">\n        The regular expressions must follow\n        <a target=\"_blank\" href=\"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/regex/Pattern.html\">Java syntax</a>. If any fragment of a label matches any regular expression in the\n        dictionary, Lingo3G will apply the dictionary-specific action to the\n        label.\n      </p>\n\n      <div class=\"warning\" id=\"label-matchers:regexp:594c1a64\">\n        <strong>Heads up, performance impact!</strong>\n\n        <p id=\"label-matchers:regexp:febcde33\">\n          Regular expression-based matching is a powerful mechanism, but it can\n          also result in a dramatic decrease of clustering performance.\n          Therefore, use it only when a similar effect cannot be achieved by a\n          reasonable number of\n          <a href=\"#label-matchers:exact\"><code>exact</code></a>\n          and <a href=\"#label-matchers:glob\"><code>glob</code></a> matching\n          entries.\n        </p>\n      </div>\n    </section>\n  </section>\n</article>","tableOfContents":[{"heading":"Types of dictionaries","anchor":"types-of-dictionaries"},{"heading":"Scopes of dictionaries","anchor":"scopes-of-dictionaries"},{"heading":"Location of dictionary files","anchor":"location-of-dictionary-files","sections":[{"heading":"Document Clustering Server","anchor":"location-of-dictionary-files:document-clustering-server"},{"heading":"Java API","anchor":"location-of-dictionary-files:java-api"}]},{"heading":"Label matchers","anchor":"label-matchers","sections":[{"heading":"Exact matcher","anchor":"label-matchers:exact"},{"heading":"Glob matcher","anchor":"label-matchers:glob","sections":[{"heading":"Matching rules","anchor":"label-matchers:glob:rules"},{"heading":"Example entries","anchor":"label-matchers:glob:examples"}]},{"heading":"Regular expression matcher","anchor":"label-matchers:regexp"}]}]}},"pageContext":{"slug":"/dictionaries/"}},"staticQueryHashes":["1164750013"]}