public class RePairRule extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
expandedRuleString |
protected RePairSymbol |
first
Both symbols, (i.e., pair).
|
protected int |
level |
protected ArrayList<Integer> |
occurrences
Occurrences.
|
protected ArrayList<RuleInterval> |
ruleIntervals
Which TS interval covered.
|
protected int |
ruleNumber
The current rule number.
|
protected RePairSymbol |
second |
| Constructor and Description |
|---|
RePairRule(RePairGrammar rg)
Constructor, assigns a rule ID using the global counter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOccurrence(int value)
Adds a rule occurrence.
|
void |
assignLevel() |
boolean |
equals(Object obj) |
RePairSymbol |
getFirst() |
int |
getId()
Rule ID getter.
|
int[] |
getLengths() |
int |
getLevel() |
int[] |
getOccurrences()
Gets occurrences.
|
ArrayList<RuleInterval> |
getRuleIntervals() |
RePairSymbol |
getSecond() |
int |
hashCode() |
void |
setExpandedRule(String str)
Set the expanded rule string.
|
void |
setFirst(RePairSymbol symbol)
First symbol setter.
|
void |
setSecond(RePairSymbol symbol)
Second symbol setter.
|
String |
toExpandedRuleString()
Return the prefixed with R rule.
|
String |
toInfoString() |
String |
toRuleString()
Return the prefixed with R rule.
|
String |
toString() |
protected int ruleNumber
protected String expandedRuleString
protected RePairSymbol first
protected RePairSymbol second
protected int level
protected ArrayList<RuleInterval> ruleIntervals
public RePairRule(RePairGrammar rg)
rg - the grammar handler.public void setFirst(RePairSymbol symbol)
symbol - the symbol to set.public RePairSymbol getFirst()
public void setSecond(RePairSymbol symbol)
symbol - the symbol to set.public RePairSymbol getSecond()
public int getId()
public String toRuleString()
public void setExpandedRule(String str)
str - the expanded rule value.public String toExpandedRuleString()
public void addOccurrence(int value)
value - the new value.public int[] getOccurrences()
public void assignLevel()
public int getLevel()
public ArrayList<RuleInterval> getRuleIntervals()
public int[] getLengths()
public String toInfoString()
Copyright © 2021 JMotif. All rights reserved.