org.apache.lucene.analysis.synonym

## Class SynonymMap.Parser

- java.lang.Object
- - org.apache.lucene.analysis.synonym.SynonymMap.Builder
  - - org.apache.lucene.analysis.synonym.SynonymMap.Parser

- Direct Known Subclasses:
    SolrSynonymParser, WordnetSynonymParser
  Enclosing class:
    SynonymMap

      public abstract static class SynonymMap.Parser
      extends SynonymMap.Builder

  Abstraction for parsing synonym files.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Parser(boolean dedup, Analyzer analyzer)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CharsRef` | `analyze(String text, CharsRefBuilder reuse)` Sugar: analyzes the text with the analyzer and separates by `SynonymMap.WORD_SEPARATOR`.
    `abstract void` | `parse(Reader in)` Parse the given input, adding synonyms to the inherited `SynonymMap.Builder`.

    - ### Methods inherited from class org.apache.lucene.analysis.synonym.SynonymMap.Builder

      `add, build, join`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Parser

          public Parser(boolean dedup,
                        Analyzer analyzer)

  - ### Method Detail

    - #### parse

          public abstract void parse(Reader in)
                              throws IOException,
                                     ParseException

      Parse the given input, adding synonyms to the inherited `SynonymMap.Builder`.
      Parameters:
        `in` - The input to parse
      Throws:
        `IOException`
        `ParseException`

    - #### analyze

          public CharsRef analyze(String text,
                                  CharsRefBuilder reuse)
                           throws IOException

      Sugar: analyzes the text with the analyzer and separates by `SynonymMap.WORD_SEPARATOR`. reuse and its chars must not be null.
      Throws:
        `IOException`

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.