<commit_before>package at.ac.univie.mminf.luceneSKOS.solr;

/**
 * Copyright 2010 <NAME> 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.analysis.util.ResourceLoader;
import org.apache.lucene.analysis.util.ResourceLoaderAware;
import org.apache.lucene.analysis.util.TokenFilterFactory;
import org.apache.solr.core.SolrResourceLoader;

import at.ac.univie.mminf.luceneSKOS.analysis.SKOSAnalyzer.ExpansionType;
import at.ac.univie.mminf.luceneSKOS.analysis.SKOSLabelFilter;
import at.ac.univie.mminf.luceneSKOS.analysis.SKOSURIFilter;
import at.ac.univie.mminf.luceneSKOS.analysis.tokenattributes.SKOSTypeAttribute.SKOSType;
import at.ac.univie.mminf.luceneSKOS.skos.SKOSEngine;
import at.ac.univie.mminf.luceneSKOS.skos.SKOSEngineFactory;

/**
 * A factory for plugging SKOS filters into Apache Solr
 */
public class SKOSFilterFactory extends TokenFilterFactory implements
    ResourceLoaderAware {
  
  private ExpansionType expansionType;
  
  private int bufferSize;
  
  private SKOSType[] type;
  
  private SKOSEngine skosEngine;
  
  protected SKOSFilterFactory(Map<String,String> args) {
    super(args);
    assureMatchVersion();
  }
  
  @Override
  public void inform(ResourceLoader loader) {
    SolrResourceLoader solrLoader = (SolrResourceLoader) loader;
    
    Map<String,String> args = getOriginalArgs();
    
    String skosFile = args.get("skosFile");
    
    String expansionTypeString = args.get("expansionType");
    
    String bufferSizeString = args.get("bufferSize");
    
    String languageString = args.get("language");
    
    String typeString = args.get("type");<commit_msg>FilterFactory constructor should be public; issue #10<commit_after>package at.ac.univie.mminf.luceneSKOS.solr;

/**
 * Copyright 2010 <NAME> 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.analysis.util.ResourceLoader;
import org.apache.lucene.analysis.util.ResourceLoaderAware;
import org.apache.lucene.analysis.util.TokenFilterFactory;
import org.apache.solr.core.SolrResourceLoader;

import at.ac.univie.mminf.luceneSKOS.analysis.SKOSAnalyzer.ExpansionType;
import at.ac.univie.mminf.luceneSKOS.analysis.SKOSLabelFilter;
import at.ac.univie.mminf.luceneSKOS.analysis.SKOSURIFilter;
import at.ac.univie.mminf.luceneSKOS.analysis.tokenattributes.SKOSTypeAttribute.SKOSType;
import at.ac.univie.mminf.luceneSKOS.skos.SKOSEngine;
import at.ac.univie.mminf.luceneSKOS.skos.SKOSEngineFactory;

/**
 * A factory for plugging SKOS filters into Apache Solr
 */
public class SKOSFilterFactory extends TokenFilterFactory implements
    ResourceLoaderAware {
  
  private ExpansionType expansionType;
  
  private int bufferSize;
  
  private SKOSType[] type;
  
  private SKOSEngine skosEngine;
  
  public SKOSFilterFactory(Map<String,String> args) {
    super(args);
    assureMatchVersion();
  }
  
  @Override
  public void inform(ResourceLoader loader) {
    SolrResourceLoader solrLoader = (SolrResourceLoader) loader;
    
    Map<String,String> args = getOriginalArgs();
    
    String skosFile = args.get("skosFile");
    
    String expansionTypeString = args.get("expansionType");
    
    String bufferSizeString = args.get("bufferSize");
    
    String languageString = args.get("language");
    
    String typeString = args.get("type");
{'fraction_non_alphanumeric': 0.09295478443743428, 'fraction_numerical': 0.0037854889589905363, 'mean_word_length': 4.435428571428571, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2371828', 'n_tokens_mistral': 1501, 'n_tokens_neox': 1453, 'n_words': 355}