Package org.apache.lucene.analysis

Examples of org.apache.lucene.analysis.CharArraySet$CharArraySetIterator


      boolean ignoreCase = false;
      String ignoreStr = args.get( KEEP_IGNORE_CASE );
      if ( "true".equalsIgnoreCase( ignoreStr ) ) {
        ignoreCase = true;
      }
      keep = new CharArraySet( 10, ignoreCase );
      while ( st.hasMoreTokens() ) {
        k = st.nextToken().trim();
        keep.add( k.toCharArray() );
      }
    }
View Full Code Here


      catch ( IOException e ) {
        throw new RuntimeException( e );
      }
    }
    else {
      stopWords = new CharArraySet( StopAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase );
    }
  }
View Full Code Here

  /**
   * Set the keep word list.
   * NOTE: if ignoreCase==true, the words are expected to be lowercase
   */
  public void setWords(Set<String> words) {
    this.words = new CharArraySet( words, ignoreCase );
  }
View Full Code Here

    this.words = new CharArraySet( words, ignoreCase );
  }

  public void setIgnoreCase(boolean ignoreCase) {
    if ( words != null && this.ignoreCase != ignoreCase ) {
      words = new CharArraySet( words, ignoreCase );
    }
    this.ignoreCase = ignoreCase;
  }
View Full Code Here

  /**
   * @deprecated Use {@link #KeepWordFilter(TokenStream, Set, boolean)} instead
   */
  @Deprecated
  public KeepWordFilter(TokenStream in, Set<String> words, boolean ignoreCase) {
    this( in, new CharArraySet( words, ignoreCase ) );
  }
View Full Code Here

      try {
        File protectedWordFiles = new File( wordFiles );
        if ( protectedWordFiles.exists() ) {
          List<String> wlist = loader.getLines( wordFiles );
          //This cast is safe in Lucene
          protectedWords = new CharArraySet(
              wlist, false
          );//No need to go through StopFilter as before, since it just uses a List internally
        }
        else {
          List<String> files = StrUtils.splitFileNames( wordFiles );
          for ( String file : files ) {
            List<String> wlist = loader.getLines( file.trim() );
            if ( protectedWords == null ) {
              protectedWords = new CharArraySet( wlist, false );
            }
            else {
              protectedWords.addAll( wlist );
            }
          }
View Full Code Here

      try {
        File protectedWordFiles = new File( wordFiles );
        if ( protectedWordFiles.exists() ) {
          List<String> wlist = loader.getLines( wordFiles );
          //This cast is safe in Lucene
          protectedWords = new CharArraySet(
              wlist, false
          );//No need to go through StopFilter as before, since it just uses a List internally
        }
        else {
          List<String> files = StrUtils.splitFileNames( wordFiles );
          for ( String file : files ) {
            List<String> wlist = loader.getLines( file.trim() );
            if ( protectedWords == null ) {
              protectedWords = new CharArraySet( wlist, false );
            }
            else {
              protectedWords.addAll( wlist );
            }
          }
View Full Code Here

  protected CharArraySet getWordSet(ResourceLoader loader,
                    String wordFiles, boolean ignoreCase) throws IOException {
    assureMatchVersion();
    List<String> files = StrUtils.splitFileNames( wordFiles );
    CharArraySet words = null;
    if ( files.size() > 0 ) {
      // default stopwords list has 35 or so words, but maybe don't make it that
      // big to start
      words = new CharArraySet( files.size() * 10, ignoreCase );
      for ( String file : files ) {
        List<String> wlist = loader.getLines( file.trim() );
        words.addAll(
            StopFilter.makeStopSet(
                wlist,
                ignoreCase
            )
        );
View Full Code Here

    super( input );
    if ( commonWords instanceof CharArraySet ) {
      this.commonWords = ( CharArraySet ) commonWords;
    }
    else {
      this.commonWords = new CharArraySet( commonWords.size(), ignoreCase );
      this.commonWords.addAll( commonWords );
    }
  }
View Full Code Here

   *
   * @deprecated create a CharArraySet with CharArraySet instead
   */
  @Deprecated
  public static CharArraySet makeCommonSet(String[] commonWords, boolean ignoreCase) {
    CharArraySet commonSet = new CharArraySet( commonWords.length, ignoreCase );
    commonSet.addAll( Arrays.asList( commonWords ) );
    return commonSet;
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.analysis.CharArraySet$CharArraySetIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.