Package it.unimi.dsi.mg4j.query.nodes

Source Code of it.unimi.dsi.mg4j.query.nodes.DoublingTermExpander

package it.unimi.dsi.mg4j.query.nodes;

import it.unimi.dsi.mg4j.query.nodes.AbstractTermExpander;
import it.unimi.dsi.mg4j.query.nodes.MultiTerm;
import it.unimi.dsi.mg4j.query.nodes.Prefix;
import it.unimi.dsi.mg4j.query.nodes.Query;
import it.unimi.dsi.mg4j.query.nodes.Term;
import it.unimi.dsi.lang.MutableString;

public class DoublingTermExpander extends AbstractTermExpander {

  @Override
  public Query expand( Term term ) {
    return new MultiTerm( term, new Term( new MutableString( term.term ).append( term.term ) ) );
  }

  @Override
  public Query expand( Prefix prefix ) {
    return new MultiTerm( new Term( prefix.prefix ), new Term( new MutableString( prefix.prefix ).append( prefix.prefix ) ) );
  }
}
TOP

Related Classes of it.unimi.dsi.mg4j.query.nodes.DoublingTermExpander

TOP
Copyright © 2018 www.massapi.com. 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.