|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Rule>
hultig.sumo.RuleList
public class RuleList
NOT YET WELL COMMENTED.
Represents a collection of sentence compression/transformation rules. These
rules were generated by the Aleph learning system, which is based on
Inductive Logic Programming (ILP). The learned rules are saved into
a file, and in this class it can be opened and their rules loaded, through
the method loadFromFile(String, int).
There is also a related method for loading rules from a given directory.
| Nested Class Summary | |
|---|---|
static class |
RuleList.SortType
The Sort criteria for the rules list. |
| Field Summary | |
|---|---|
static int |
ASCENDING
Defines the ascending sorting criterion. |
static int |
DESCENDING
Defines the descending sorting criterion constant. |
RuleList.SortType |
STYPE
|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
RuleList()
The default constructor. |
|
| Method Summary | |
|---|---|
int |
compare(Rule ra,
Rule rb)
Compare two rules based on their coverage values. |
void |
loadFromDir(String dirname,
int mincover)
Loads sentence reduction rules from a given directory. |
boolean |
loadFromFile(String fname,
int mincover)
Loads a set of sentence reduction rules, generated by Aleph, from a given text file. |
static void |
main(String[] args)
Exemplifies the main operation of this class. |
void |
print()
Outputs the whole list of sentence reduction rules. |
void |
printEntailments()
|
int |
removeDuplicateRules()
Eliminates duplicate rules, from this rule list. |
void |
sort()
Sorts this list of reduction rules, according to the specified comparator and criterion. |
void |
sort(int mode)
|
void |
sort(int mode,
RuleList.SortType stype)
|
| Methods inherited from class java.util.ArrayList |
|---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Field Detail |
|---|
public static final int ASCENDING
public static final int DESCENDING
public RuleList.SortType STYPE
| Constructor Detail |
|---|
public RuleList()
| Method Detail |
|---|
public boolean loadFromFile(String fname,
int mincover)
fname - The name of the file.mincover - Loads rules having coverage greater than this parameter.
public void loadFromDir(String dirname,
int mincover)
dirname - The directory from which to scan for rule files.mincover - Loads rules having coverage greater than this parameter.
public int compare(Rule ra,
Rule rb)
compare in interface Comparator<Rule>ra - The first rule.rb - The second rule.
ra < rb , ra = rb, or ra > rb.public void sort()
public void sort(int mode)
public void sort(int mode,
RuleList.SortType stype)
public int removeDuplicateRules()
public void printEntailments()
public void print()
public static void main(String[] args)
args - The array of arguments.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||