forked from UnitexGramLab/gramlab-ide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix UnitexGramLab#110] Resolving a bug in the construction of POS-list
Implementation of Kleene's algorithm in order to transform an automaton into a regular expression
- Loading branch information
Showing
8 changed files
with
983 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package fr.umlv.unitex.expr; | ||
|
||
import java.util.List; | ||
|
||
public class Concatenation extends Operator { | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (!(o instanceof Value)) { | ||
return false; | ||
} | ||
Concatenation c= (Concatenation) o; | ||
return c.getOperands().equals(this.getOperands()); | ||
} | ||
|
||
|
||
@Override | ||
protected String getOpSymbol() { | ||
return " "; | ||
} | ||
|
||
|
||
|
||
public String getOpeningSymbol() { | ||
return ""; | ||
} | ||
|
||
public String getClosingSymbol() { | ||
return ""; | ||
} | ||
|
||
|
||
/* | ||
public void addOperand(Parallelization p) { | ||
super.addOperand(p); | ||
} | ||
*/ | ||
|
||
/* | ||
public void addOperand(Value v) { | ||
super.addOperand(v); | ||
} | ||
*/ | ||
|
||
/* | ||
public void addOperand(Value v) { | ||
this.addOperand(v); | ||
} | ||
*/ | ||
|
||
/* | ||
public void addOperand(Concatenation c) { | ||
List<Expression> list = c.getOperands(); | ||
for (Expression e : list) { | ||
this.addOperand(e); | ||
} | ||
} | ||
*/ | ||
|
||
|
||
public void addOperand(Expression expr) { | ||
if (expr instanceof Concatenation) { | ||
for (Expression e : expr.getOperands()) { | ||
this.addOperand(e); | ||
} | ||
} | ||
else { | ||
super.addOperand(expr); | ||
} | ||
} | ||
|
||
|
||
public void addOperands(Expression expr, int start, int end) { | ||
List<Expression> list = expr.getOperands(); | ||
for (int i = start; i < end; i++) { | ||
this.addOperand(list.get(i)); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
/* | ||
public void addOperand(Expression expr, int start, int end) { | ||
List<Expression> list = expr.getOperands(); | ||
for (int i = start; i < end; i++) { | ||
this.addOperand(list.get(i)); | ||
} | ||
} | ||
*/ | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package fr.umlv.unitex.expr; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public interface Expression { | ||
|
||
|
||
List<Expression> getOperands(); | ||
|
||
int getOperandsSize(); | ||
|
||
|
||
} |
Oops, something went wrong.