Commits

Yoav Artzi  committed 81d0ac8

# v1.5.5
- Bug in identifying full parses when using unary rules.

  • Participants
  • Parent commits 48e1a81
  • Tags v1.5.5

Comments (0)

Files changed (6)

File ChangeLog.md

+# v1.5.5
+- Bug in identifying full parses when using unary rules.
+
 # v1.5.4
 - Introduce a readers system to read logical expressions from text. Also, make logical expression equality more flexible. Makes it easier to add new logical expression objects to hierarchy. 
 - Various minor (but important) optimizations. 

File build.properties

 src.genlex.ccg.unification = genlex.ccg.unification/src
 src.geoquery=geoquery/src
 mainclass=edu.uw.cs.lil.tiny.utils.main.Main
-version=1.5.4
+version=1.5.5

File parser.ccg.cky/src/edu/uw/cs/lil/tiny/parser/ccg/cky/AbstractCKYParser.java

 						for (final AbstractCKYParseStep<MR> step : cell
 								.getSteps()) {
 							// Create the combined parse step and the new cell.
-							final Cell<MR> newCell = cellFactory.create(
-									step.cloneWithUnary(transformed, model),
-									start, end);
+							final Cell<MR> newCell = cellFactory.create(step
+									.cloneWithUnary(
+											transformed,
+											model,
+											isFullParse(start, end, transformed
+													.getResultCategory(),
+													sentenceLength)), start,
+									end);
 							LOG.debug("Created new cell: %s", newCell);
 							newCells.add(newCell);
 						}
 						for (final AbstractCKYParseStep<MR> step : cell
 								.getSteps()) {
 							// Create the combined parse step and the new cell.
-							final Cell<MR> newCell = cellFactory.create(
-									step.cloneWithUnary(transformed, model),
-									start, end);
+							final Cell<MR> newCell = cellFactory.create(step
+									.cloneWithUnary(
+											transformed,
+											model,
+											isFullParse(start, end, transformed
+													.getResultCategory(),
+													sentenceLength)), start,
+									end);
 							LOG.debug("Created new cell: %s", newCell);
 							
 							if (queue.contains(newCell)) {

File parser.ccg.cky/src/edu/uw/cs/lil/tiny/parser/ccg/cky/chart/AbstractCKYParseStep.java

 	 * and appending the result rule name to the step rule name.
 	 */
 	public abstract AbstractCKYParseStep<MR> cloneWithUnary(
-			ParseRuleResult<MR> ruleResult, IDataItemModel<MR> model);
+			ParseRuleResult<MR> unaryRuleResult, IDataItemModel<MR> model,
+			boolean fullParseAfterUnary);
 	
 	@Override
 	public boolean equals(Object obj) {

File parser.ccg.cky/src/edu/uw/cs/lil/tiny/parser/ccg/cky/chart/CKYLexicalStep.java

 	}
 	
 	@Override
-	public CKYLexicalStep<MR> cloneWithUnary(ParseRuleResult<MR> ruleResult,
-			IDataItemModel<MR> model) {
-		if (!(ruleResult.getRuleName() instanceof UnaryRuleName)) {
+	public AbstractCKYParseStep<MR> cloneWithUnary(
+			ParseRuleResult<MR> unaryRuleResult, IDataItemModel<MR> model,
+			boolean fullParseAfterUnary) {
+		if (!(unaryRuleResult.getRuleName() instanceof UnaryRuleName)) {
 			throw new IllegalStateException(
-					"Provided result is not from a unary rule: " + ruleResult);
+					"Provided result is not from a unary rule: "
+							+ unaryRuleResult);
 		}
-		return new CKYLexicalStep<MR>(ruleResult.getResultCategory(),
-				lexicalEntry, isFullParse,
-				ruleName.overload((UnaryRuleName) ruleResult.getRuleName()),
+		return new CKYLexicalStep<MR>(
+				unaryRuleResult.getResultCategory(),
+				lexicalEntry,
+				fullParseAfterUnary,
+				ruleName.overload((UnaryRuleName) unaryRuleResult.getRuleName()),
 				model);
+		
 	}
 	
 	@Override

File parser.ccg.cky/src/edu/uw/cs/lil/tiny/parser/ccg/cky/chart/CKYParseStep.java

 	}
 	
 	@Override
-	public CKYParseStep<MR> cloneWithUnary(ParseRuleResult<MR> ruleResult,
-			IDataItemModel<MR> model) {
-		if (!(ruleResult.getRuleName() instanceof UnaryRuleName)) {
+	public CKYParseStep<MR> cloneWithUnary(ParseRuleResult<MR> unaryRuleResult,
+			IDataItemModel<MR> model, boolean fullParseAfterUnary) {
+		if (!(unaryRuleResult.getRuleName() instanceof UnaryRuleName)) {
 			throw new IllegalStateException(
-					"Provided result is not from a unary rule: " + ruleResult);
+					"Provided result is not from a unary rule: "
+							+ unaryRuleResult);
 		}
-		return new CKYParseStep<MR>(ruleResult.getResultCategory(),
-				children.get(0), isUnary ? null : children.get(1), isFullParse,
-				ruleName.overload((UnaryRuleName) ruleResult.getRuleName()),
+		return new CKYParseStep<MR>(
+				unaryRuleResult.getResultCategory(),
+				children.get(0),
+				isUnary ? null : children.get(1),
+				fullParseAfterUnary,
+				ruleName.overload((UnaryRuleName) unaryRuleResult.getRuleName()),
 				model);
 	}
 }