class_docstr: Annotator to match exact phrases (by token) provided in a file against a
  Document.
  
  A text file of predefined phrases must be provided with
  :meth:`.setEntities`.
  
  For extended examples of usage, see the `Examples
  <https://github.com/JohnSnowLabs/spark-nlp/blob/master/examples/python/annotation/text/english/text-matcher-pipeline/extractor.ipynb>`__.
  
  ====================== ======================
  Input Annotation types Output Annotation type
  ====================== ======================
  ``DOCUMENT, TOKEN``    ``CHUNK``
  ====================== ======================
  
  Parameters
  ----------
  entities
      ExternalResource for entities
  caseSensitive
      Whether to match regardless of case, by default True
  mergeOverlapping
      Whether to merge overlapping matched chunks, by default False
  entityValue
      Value for the entity metadata field
  buildFromTokens
      Whether the TextMatcher should take the CHUNK from TOKEN or not
  
  Examples
  --------
  In this example, the entities file is of the form::
  
      ...
      dolore magna aliqua
      lorem ipsum dolor. sit
      laborum
      ...
  
  where each line represents an entity phrase to be extracted.
  
  >>> import sparknlp
  >>> from sparknlp.base import *
  >>> from sparknlp.annotator import *
  >>> from pyspark.ml import Pipeline
  >>> documentAssembler = DocumentAssembler() \
  ...     .setInputCol("text") \
  ...     .setOutputCol("document")
  >>> tokenizer = Tokenizer() \
  ...     .setInputCols(["document"]) \
  ...     .setOutputCol("token")
  >>> data = spark.createDataFrame([["Hello dolore magna aliqua. Lorem ipsum dolor. sit in laborum"]]).toDF("text")
  >>> entityExtractor = TextMatcher() \
  ...     .setInputCols(["document", "token"]) \
  ...     .setEntities("src/test/resources/entity-extractor/test-phrases.txt", ReadAs.TEXT) \
  ...     .setOutputCol("entity") \
  ...     .setCaseSensitive(False)
  >>> pipeline = Pipeline().setStages([documentAssembler, tokenizer, entityExtractor])
  >>> results = pipeline.fit(data).transform(data)
  >>> results.selectExpr("explode(entity) as result").show(truncate=False)
  +------------------------------------------------------------------------------------------+
  |result                                                                                    |
  +------------------------------------------------------------------------------------------+
  |[chunk, 6, 24, dolore magna aliqua, [entity -> entity, sentence -> 0, chunk -> 0], []]    |
  |[chunk, 27, 48, Lorem ipsum dolor. sit, [entity -> entity, sentence -> 0, chunk -> 1], []]|
  |[chunk, 53, 59, laborum, [entity -> entity, sentence -> 0, chunk -> 2], []]               |
  +------------------------------------------------------------------------------------------+
  
  See Also
  --------
  BigTextMatcher : to match large amounts of text
class_docstr_tok: ["Annotator","to","match","exact","phrases","(","by","token",")","provided","in","a","file","against","a","Document",".","A","text","file","of","predefined","phrases","must","be","provided","with",":","meth",":","`",".setEntities","`",".","For","extended","examples","of","usage",",","see","the","`","Examples","<","https",":","\/\/github.com\/JohnSnowLabs\/spark-nlp\/blob\/master\/examples\/python\/annotation\/text\/english\/text-matcher-pipeline\/extractor.ipynb",">","`","__",".","======================","======================","Input","Annotation","types","Output","Annotation","type","======================","======================","``","DOCUMENT",",","TOKEN","``","``","CHUNK","``","======================","======================","Parameters","--","--","--","--","--","entities","ExternalResource","for","entities","caseSensitive","Whether","to","match","regardless","of","case",",","by","default","True","mergeOverlapping","Whether","to","merge","overlapping","matched","chunks",",","by","default","False","entityValue","Value","for","the","entity","metadata","field","buildFromTokens","Whether","the","TextMatcher","should","take","the","CHUNK","from","TOKEN","or","not","Examples","--","--","--","--","In","this","example",",","the","entities","file","is","of","the","form",":",":","...","dolore","magna","aliqua","lorem","ipsum","dolor",".","sit","laborum","...","where","each","line","represents","an","entity","phrase","to","be","extracted",".",">",">",">","import","sparknlp",">",">",">","from","sparknlp.base","import","*",">",">",">","from","sparknlp.annotator","import","*",">",">",">","from","pyspark.ml","import","Pipeline",">",">",">","documentAssembler","=","DocumentAssembler","(",")","\\","...",".setInputCol","(","``","text","''",")","\\","...",".setOutputCol","(","``","document","''",")",">",">",">","tokenizer","=","Tokenizer","(",")","\\","...",".setInputCols","(","[","``","document","''","]",")","\\","...",".setOutputCol","(","``","token","''",")",">",">",">","data","=","spark.createDataFrame","(","[","[","``","Hello","dolore","magna","aliqua",".","Lorem","ipsum","dolor",".","sit","in","laborum","''","]","]",")",".toDF","(","``","text","''",")",">",">",">","entityExtractor","=","TextMatcher","(",")","\\","...",".setInputCols","(","[","``","document","''",",","``","token","''","]",")","\\","...",".setEntities","(","``","src\/test\/resources\/entity-extractor\/test-phrases.txt","''",",","ReadAs.TEXT",")","\\","...",".setOutputCol","(","``","entity","''",")","\\","...",".setCaseSensitive","(","False",")",">",">",">","pipeline","=","Pipeline","(",")",".setStages","(","[","documentAssembler",",","tokenizer",",","entityExtractor","]",")",">",">",">","results","=","pipeline.fit","(","data",")",".transform","(","data",")",">",">",">","results.selectExpr","(","``","explode","(","entity",")","as","result","''",")",".show","(","truncate=False",")","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|result","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","|","[","chunk",",","6",",","24",",","dolore","magna","aliqua",",","[","entity","-",">","entity",",","sentence","-",">","0",",","chunk","-",">","0","]",",","[","]","]","|","|","[","chunk",",","27",",","48",",","Lorem","ipsum","dolor",".","sit",",","[","entity","-",">","entity",",","sentence","-",">","0",",","chunk","-",">","1","]",",","[","]","]","|","|","[","chunk",",","53",",","59",",","laborum",",","[","entity","-",">","entity",",","sentence","-",">","0",",","chunk","-",">","2","]",",","[","]","]","|","+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","+","See","Also","--","--","--","--","BigTextMatcher",":","to","match","large","amounts","of","text"]
docstr: Sets whether to merge overlapping matched chunks, by default False.
  
  Parameters
  ----------
  b : bool
      Whether to merge overlapping matched chunks
docstr_tok: ["Sets","whether","to","merge","overlapping","matched","chunks",",","by","default","False",".","Parameters","--","--","--","--","--","b",":","bool","Whether","to","merge","overlapping","matched","chunks"]
code: def setMergeOverlapping(self, b):
      """Sets whether to merge overlapping matched chunks, by default False.
  
      Parameters
      ----------
      b : bool
          Whether to merge overlapping matched chunks
      """
      return self._set(mergeOverlapping=b)
  
file_path: spark-nlp/python/sparknlp/annotator/matcher/text_matcher.py
imports: from sparknlp.common import *
label_desc: Use image node_id 5 for calling the TextMatcher obj's underlying member method code with example usage: obj.setMergeOverlapping(b) and returns: self