/** * Given a parse tree, derived from the text, an instance of this interface can measure * the gap between it and the hypothesis parse tree. This measure is a single real number, * which can be used as the h(x) function in search algorithms. * <P> * An instance of this interface is part of {@link GapToolInstances}, which is * constructed in the <code>init()</code> method of {@link InitializationTextTreesProcessor}. * * @see GapToolInstances * * @author Asher Stern * @since Aug 1, 2013 * */ @NotThreadSafe public interface GapHeuristicMeasure<I, S extends AbstractNode<I, S>> { public double measure(TreeAndParentMap<I, S> tree, Map<Integer, Double> featureVector, GapEnvironment<I, S> environment) throws GapException; }
/** * @author Amnon Lotan * * @since Jul 11, 2012 */ @LanguageDependent("English") @ParserSpecific("easyfirst") public class TruthTellerConstants { /** * if a node is the nsubj of a "there is" construction (with a "there/EX/expl" node), replace the relation with dobj */ public static final boolean AMMEND_COMPLEMENT_RELATION_IN_EXPLATIVE_PHRASES = true; /** * This is the CT assigned by {@link ClauseTruthAnnotationRuleApplier} to predicates where no information is available. * By implication, it is also the default PT value. */ public static final ClauseTruth DEFAULT_CT = ClauseTruth.U; /** * This flag decides whether to include {@link ComplementRelations#NOMINAL_RELATION} (some {@link StanfordDepedencyRelationType}s between a predicate and a * nominal modifier that is not usually considered an argument/complement, like * {@link StanfordDepedencyRelationType#nn} ) in the bigger complement relations list. That list is used in the {@link ClauseTruthAnnotationRuleApplier} to identify * and annotate complements of each visited predicate. */ public static final boolean INCLUDE_NOMINAL_RELATIONS_IN_THE_COMPLEMENT_RELATIONS = false; }
/** * A tool-box, global for the system, which creates utilities to measure gaps * between text parse trees and hypothesis parse trees. * * @see GapToolBoxFactory * @see SystemInitialization * @see TESystemEnvironment * * @author Asher Stern * @since Aug 1, 2013 * * @param <I> * @param <S> */ @ThreadSafe public interface GapToolBox<I, S extends AbstractNode<I, S>> { public boolean isHybridMode() throws GapException; public GapToolsFactory<I, S> getGapToolsFactory() throws GapException; }
@ParserSpecific({"minipar","easyfirst"}) public class ParserSpecificConfigurations
/** * Holds a map from Nomlex relations to Stanford-dependencies relations. * @author Asher Stern * @since Oct 15, 2012 * */ @StandardSpecific({"stanford-dependencies","nomlex"}) public class PlaceToRelationMap { public static ImmutableMap<String, Set<String>> getMapPlaceToRelation() { return IMMUTABLE_MAP_PLACE_TO_RELATIONS; } private static final Map<String, Set<String>> MAP_PLACE_TO_RELATIONS; private static final ImmutableMap<String, Set<String>> IMMUTABLE_MAP_PLACE_TO_RELATIONS; static { MAP_PLACE_TO_RELATIONS = new LinkedHashMap<String, Set<String>>(); MAP_PLACE_TO_RELATIONS.put("DET-POSS", Collections.singleton("poss")); MAP_PLACE_TO_RELATIONS.put("N-N-MOD", Collections.singleton("nn")); IMMUTABLE_MAP_PLACE_TO_RELATIONS = new ImmutableMapWrapper<String, Set<String>>(MAP_PLACE_TO_RELATIONS); } }
@LanguageDependent("english") @ParserSpecific("easyfirst") public class IsAConstructionOperation extends GenerationOperationForExtendedNode
/** * A container of rule-bases and plug-ins. * Note that an {@link OperationsScript} is a rule-bases-and-plug-ins container. * * * @see OperationsScript * * @author Asher Stern * @since Apr 3, 2011 * */ @NotThreadSafe public abstract class RuleBasesAndPluginsContainer<I,S extends AbstractNode<I, S>> { public abstract LinkedHashSet<String> getRuleBasesNames(); public abstract ByLemmaPosLexicalRuleBase<LexicalRule> getByLemmaPosLexicalRuleBase(String name) throws OperationException; public abstract ByLemmaLexicalRuleBase getByLemmaLexicalRuleBase(String name) throws OperationException; public abstract RuleBaseEnvelope<I, S> getRuleBaseEnvelope(String name) throws OperationException; public abstract RuleBaseEnvelope<I, S> getMetaRuleBaseEnvelope(String metaRuleBaseName) throws OperationException; public abstract Plugin getPlugin(String pluginId) throws TeEngineMlException; }
@Override @ParserSpecific({"easyfirst"}) public List<RuleMatch<Info, BasicNode>> findMatches(BasicNode currentTree) throws SyntacticResourceException { return findMatches1(currentTree,null); }
/** * A base class for factory-class that creates an instance of a particular plug-in. * <P> * <B>Thread safety:</B> {@link InstanceBasedPluginFactory} is shared among threads * (i.e., two threads will have the same instance of {@link InstanceBasedPluginFactory}, * and might call its methods simultaneously). * * @author Asher Stern * @since Jan 29, 2012 * */ @ThreadSafe public abstract class InstanceBasedPluginFactory extends AbstractPluginFactory<InstanceBasedPlugin> { protected InstanceBasedPluginFactory(String pluginId, ImmutableSet<String> customFeatures) throws PluginException { super(pluginId, customFeatures); } @Override public abstract InstanceBasedPlugin createPluginImplementation() throws PluginException; }
@LanguageDependent("english") @ParserSpecific("easyfirst") public class EasyFirst_IsA_Constructor
@NotThreadSafe public class OperationsScriptGetter
/** * A base class for factory-class that creates an instance of a particular plug-in. * <P> * <B>Thread safety:</B> {@link PluginFactory} is shared among threads (i.e., * two threads will have the same instance of {@link PluginFactory}, and might * call its methods simultaneously). * * @author Asher Stern * @since Jan 27, 2012 * */ @ThreadSafe public abstract class PluginFactory extends AbstractPluginFactory<Plugin> { protected PluginFactory(String pluginId, ImmutableSet<String> customFeatures) throws PluginException { super(pluginId, customFeatures); } /* * (non-Javadoc) * @see ac.biu.nlp.nlp.engineml.plugin.AbstractPluginFactory#createPluginImplementation() */ @Override public abstract Plugin createPluginImplementation() throws PluginException; }
@NotThreadSafe public class AlignmentCalculator extends AbstractAlignmentCalculator<ExtendedInfo, ExtendedNode>
@ThreadSafe public class SynchronizedAtomicAnnotator
@NotThreadSafe public abstract class Plugin
@ThreadSafe public abstract class AbstractPluginFactory<T extends Plugin>
@NotThreadSafe public abstract class InstanceBasedPlugin extends Plugin
@NotThreadSafe public class GapToolInstances<I, S extends AbstractNode<I, S>>
@NotThreadSafe public interface SentenceAnnotator
@NotThreadSafe public abstract class ByLemmaPosLexicalRuleBaseWithCache<T extends LexicalRule> extends ByLemmaPosLexicalRuleBase<T>