ActiveAlternativeConstruction.java from Texai at Krugle
Show ActiveAlternativeConstruction.java syntax highlighted
/*
* ActiveAlternativeConstruction.java
*
* Created on January 26, 2007, 5:16 PM
*
* Description: Provides a construction, decorating a AlternativeConstruction domain entity, which contains
* the behavior and transient state required for parsing text.
*
* Copyright (C) 2007 Stephen L. Reed.
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.texai.grammar.understanding;
import java.util.Set;
import org.texai.grammar.Constituent;
import org.texai.grammar.understanding.ActiveWordFormConstruction;
import org.texai.grammar.understanding.ActiveRegularExpression;
/**
*
* @author reed
*/
public final class ActiveAlternativeConstruction extends AbstractActiveComposedConstruction {
/** Creates a new instance of ActiveAlternativeConstruction. */
public ActiveAlternativeConstruction() {
super();
}
/** Creates a new instance of ActiveAlternativeConstruction.
*
* @param construction the prototype abstract construction
*/
public ActiveAlternativeConstruction(final Constituent construction) {
super(construction);
setLoggerUsingClass(this.getClass());
}
/** Descends the leftmost branches of the child constituent tree and activate the constructions down to the leaf.
*
* @param activeComposedConstructions the set of active composed constructions
* @param activeWordConstructions the set of active word constructions
* @param activeCategoryConstructions the set of active category constructions
* @param activeRegularExpressionConstructions the set of active regular expression constructions
* @param activeParentComposedConstruction the active parent composed construction
*/
public void activateDownToLeafConstituent(
ActiveComposedConstructionSet activeComposedConstructions,
Set<ActiveWordFormConstruction> activeWordConstructions,
Set<ActiveCategoryConstruction> activeCategoryConstructions,
Set<ActiveRegularExpression> activeRegularExpressionConstructions,
ActiveComposedConstruction activeParentComposedConstruction) {
assert activeComposedConstructions != null : "activeComposedConstructions must not be null";
assert activeWordConstructions != null : "activeWordConstructions must not be null";
assert activeCategoryConstructions != null : "activeCategoryConstructions must not be null";
assert activeRegularExpressionConstructions != null : "activeRegularExpressionConstructions must not be null";
assert activeParentComposedConstruction != null : "activeParentComposedConstruction must not be null";
//TODO
}
/**
* Advances to the next child constituent when this object is an active construction.
*
* @param activeComposedConstructions the set of active composed constructions
* @param activeWordConstructions the set of active word constructions
* @param activeCategoryConstructions the set of active category constructions
* @param activeRegularExpressionConstructions the set of active regular expression constructions
* @param completedChildConstituent the previous child constituent that just completed
*/
public void advance(
final ActiveComposedConstructionSet activeComposedConstructions,
final Set<ActiveWordFormConstruction> activeWordConstructions,
final Set<ActiveCategoryConstruction> activeCategoryConstructions,
final Set<ActiveRegularExpression> activeRegularExpressionConstructions,
final ActiveConstituent completedChildConstituent) {
//Preconditions
assert activeComposedConstructions != null : "activeComposedConstructions must not be null";
assert activeWordConstructions != null : "activeWordConstructions must not be null";
assert activeCategoryConstructions != null : "activeCategoryConstructions must not be null";
assert activeRegularExpressionConstructions != null : "activeRegularExpressionConstructions must not be null";
assert completedChildConstituent != null : "completedChildConstituent must not be null";
//TODO
}
/** Dooms this composed construction if warranted by the doomed child constituent.
*
* @param activeComposedConstructions the set of active composed constructions
* @param doomedChildConstituent the doomed child constituent
*/
public void doomed(
final ActiveComposedConstructionSet activeComposedConstructions,
final ActiveConstituent doomedChildConstituent) {
//Preconditions
assert activeComposedConstructions != null : "activeComposedConstructions must not be null";
assert doomedChildConstituent != null : "doomedChildConstituent must not be null";
//TODO
}
}
See more files for this project here