Class StopWords

java.lang.Object
org.basex.util.ft.StopWords

public final class StopWords extends Object
Stop words for full-text requests.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
    StopWords(Data data, String file)
    Constructor, reading stopword list from disk.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(byte[] token)
    Adds the specified stopword.
    void
    compile(Data data)
    Compiles the stop word list.
    boolean
    contains(byte[] token)
    Checks if the specified stopword exists.
    void
    read(IO file, boolean exclude)
    Reads a stop words file.
    void
    remove(byte[] token)
    Removes the specified stopword.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StopWords

      public StopWords()
      Default constructor.
    • StopWords

      public StopWords(Data data, String file) throws IOException
      Constructor, reading stopword list from disk. And creating database stopword file.
      Parameters:
      data - data reference
      file - stopwords file (can be empty string)
      Throws:
      IOException - I/O exception
  • Method Details

    • compile

      public void compile(Data data)
      Compiles the stop word list.
      Parameters:
      data - data reference
    • read

      public void read(IO file, boolean exclude) throws IOException
      Reads a stop words file.
      Parameters:
      file - file reference
      exclude - exclude stop words
      Throws:
      IOException - I/O exception
    • contains

      public boolean contains(byte[] token)
      Checks if the specified stopword exists.
      Parameters:
      token - token to be looked up
      Returns:
      result of check
    • remove

      public void remove(byte[] token)
      Removes the specified stopword.
      Parameters:
      token - token to be removed
    • add

      public void add(byte[] token)
      Adds the specified stopword.
      Parameters:
      token - token to be added