public class ConceptManager
extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ConceptManager.ConceptsToInclude
Which concepts are to be included in the relation table.
|
Modifier and Type | Field and Description |
---|---|
(package private) static int |
col |
static int |
COL_CONCEPT_1 |
static int |
COL_CONCEPT_2 |
static int |
COL_CONCEPT_LABEL_1 |
static int |
COL_CONCEPT_LABEL_2 |
static int |
COL_RELATION |
static int |
COL_RELATION_LABEL |
static int |
COL_SENTENCE_LABEL |
static int |
COL_SUBGRAPH |
(package private) static JTable |
conceptTable |
static ArrayList |
conceptTypeList |
static Action |
makeTypeHierarchyAction
An action for augmenting a CharGer type hierarchy, suitable for adding to
menus and buttons.
|
static TypeLabel |
top |
Constructor and Description |
---|
ConceptManager() |
Modifier and Type | Method and Description |
---|---|
private static void |
addNewTypeLabels(Graph g)
Adds any new type labels (i.e., not already in the type label graph) to
the given type hierarchy graph.
|
static String |
binaryRelationTableEntryToHTML(ArrayList tableEntry)
Creates html TD tags that must be enclosed in TR and TABLE tags somewhere
else.
|
static String |
convertTriplesToHTMLtable(ArrayList triples,
String summary)
Converts a ArrayList of tableEntry's to an HTML work sheet (usable for
manual analysis of the relations), with a summary.
|
private static void |
fillInGlossaryDefinitions(Graph g)
Fills in a hierarchy graph with definitions found from any source.
|
static TypeLabel[] |
findBySynset(net.didion.jwnl.data.Synset s,
Graph g)
Seeks out nodes one of whose type descriptors contains the synset given.
|
static AbstractTypeDescriptor |
findLongestTermAlreadyDefined(ArrayList wordlist,
int startWord)
Starting with the word at the startWord position, find the longest term
that has a definition somewhere in the set of repertory grids.
|
static ArrayList |
getAll(GraphObject pattern)
Finds all instances of the given kind of object in all available graphs.
|
static Vector |
getAllConcepts(ConceptManager.ConceptsToInclude selector)
Prepares a vector of (concept label, filename, concept object ) from all
open graphs.
|
static ArrayList<BinaryTuple> |
getAllRelationTuples(ConceptManager.ConceptsToInclude selector)
Prepares a list each of whose entries is a (nested) arraylist as
described in makeTableEntryArrayList.
|
static ArrayList<BinaryTuple> |
getBinaryRelationTuples(ConceptManager.ConceptsToInclude selector)
Prepares a list each of whose entries is a (nested) liat as described in
makeTableEntryArrayList.
|
static ArrayList<BinaryTuple> |
getBinaryRelationTuples(Graph g,
ConceptManager.ConceptsToInclude selector)
Gathers together all the binary relation tuples in a given graph.
|
static TableModel |
getBinaryTupleModel(ConceptManager.ConceptsToInclude selector)
A triple is a set of concept-relation-concept tuples.
|
static JTable |
getBinaryTupleTable(ConceptManager.ConceptsToInclude selector)
A triple is a set of concept-relation-concept tuples.
|
static Vector |
getConceptColumnLabels() |
static JTable |
getConceptTable()
Gather all concepts - same as getConceptTable( ALL )
|
static JTable |
getConceptTable(ConceptManager.ConceptsToInclude selector)
Gather all concepts according to the selector.
|
static AbstractTypeDescriptor[] |
getSensesFromPhrase(String phrase,
WordnetManager wnmgr)
Try to establish senses for the attribute phrase for a given row of the
repertory grid table.
|
static void |
linkHypernyms(TypeLabel t,
net.didion.jwnl.data.Synset s,
Graph h)
Looks for type labels possessing synsets that are hypernyms (either
direct or indirect) of the given synset.
|
static void |
linkTypeLabels(Graph h) |
static String |
makeSentence(Concept c1,
GNode rel,
Concept c2)
Makes a matching schemme suitable for matching binary relations with the
target graph.
|
static String |
makeSentenceOLD(Concept c1,
GNode rel,
Concept c2) |
protected static ArrayList |
makeTableEntryArrayList(Concept c1,
GNode rel,
Concept c2,
ConceptManager.ConceptsToInclude selector)
Constructs a single table entry from a charger concept-relation-concept
set.
|
static String |
makeTerm(ArrayList _words,
int startWord,
int endWord)
create a sub-term by taking the words from startWord to endWord - 1
|
static Graph |
makeTypeHierarchy()
Create a graph in a window that reflects the inferred type hierarchy.
|
private static boolean |
okayToAddTypeLabel(Concept c,
ArrayList typelabelvector)
Determine whether a given concept's type label should be added to a type
hierarchy.
|
private static boolean |
swapBinaryRelation(Concept c1,
GNode rel,
Concept c2)
Decides heuristically whether to exchange the sense of the relationship,
regardless of the arrow direction.
|
static JTable conceptTable
static int col
public static final int COL_SENTENCE_LABEL
public static final int COL_CONCEPT_LABEL_1
public static final int COL_RELATION_LABEL
public static final int COL_CONCEPT_LABEL_2
public static final int COL_CONCEPT_1
public static final int COL_RELATION
public static final int COL_CONCEPT_2
public static final int COL_SUBGRAPH
public static ArrayList conceptTypeList
public static TypeLabel top
public static Action makeTypeHierarchyAction
Global.strs(java.lang.String)
,
makeTypeHierarchy()
public static JTable getConceptTable()
public static JTable getBinaryTupleTable(ConceptManager.ConceptsToInclude selector)
selector
- whether to gather all concepts or just generic onesgetConceptTable()
,
getBinaryRelationTuples(charger.obj.Graph, kb.ConceptManager.ConceptsToInclude)
public static TableModel getBinaryTupleModel(ConceptManager.ConceptsToInclude selector)
selector
- whether to gather all concepts or just generic onesgetConceptTable()
,
getBinaryRelationTuples(charger.obj.Graph, kb.ConceptManager.ConceptsToInclude)
public static JTable getConceptTable(ConceptManager.ConceptsToInclude selector)
selector
- tells which collection of concepts to gather: one of
GENERIC_ONLY or ALLgetAllConcepts(kb.ConceptManager.ConceptsToInclude)
public static Vector getConceptColumnLabels()
public static ArrayList getAll(GraphObject pattern)
pattern
- An empty instance indicating the class (or superclass) of
the objects to be collected.public static Vector getAllConcepts(ConceptManager.ConceptsToInclude selector)
selector
- one of GENERIC_ONLY or ALLpublic static ArrayList<BinaryTuple> getBinaryRelationTuples(Graph g, ConceptManager.ConceptsToInclude selector)
g
- The charger graph whose relations are to be examined.selector
- Which concepts to gather.makeTableEntryArrayList(charger.obj.Concept, charger.obj.GNode, charger.obj.Concept, kb.ConceptManager.ConceptsToInclude)
public static ArrayList<BinaryTuple> getBinaryRelationTuples(ConceptManager.ConceptsToInclude selector)
selector
- Which concepts to gather.getConceptTable()
,
makeTableEntryArrayList(charger.obj.Concept, charger.obj.GNode, charger.obj.Concept, kb.ConceptManager.ConceptsToInclude)
public static ArrayList<BinaryTuple> getAllRelationTuples(ConceptManager.ConceptsToInclude selector)
selector
- Which concepts to gather.getConceptTable()
,
makeTableEntryArrayList(charger.obj.Concept, charger.obj.GNode, charger.obj.Concept, kb.ConceptManager.ConceptsToInclude)
protected static ArrayList makeTableEntryArrayList(Concept c1, GNode rel, Concept c2, ConceptManager.ConceptsToInclude selector)
public static String convertTriplesToHTMLtable(ArrayList triples, String summary)
triples
- a ArrayList of binary relation table entries.summary
- string used to identify the table in HTML, but not
otherwise displayed.makeTableEntryArrayList(charger.obj.Concept, charger.obj.GNode, charger.obj.Concept, kb.ConceptManager.ConceptsToInclude)
public static String binaryRelationTableEntryToHTML(ArrayList tableEntry)
private static boolean swapBinaryRelation(Concept c1, GNode rel, Concept c2)
public static String makeSentence(Concept c1, GNode rel, Concept c2)
public static AbstractTypeDescriptor[] getSensesFromPhrase(String phrase, WordnetManager wnmgr)
public static String makeTerm(ArrayList _words, int startWord, int endWord)
public static AbstractTypeDescriptor findLongestTermAlreadyDefined(ArrayList wordlist, int startWord)
null
if
none found.KnowledgeManager.findTypeDescriptor(java.lang.String, boolean)
public static Graph makeTypeHierarchy()
KnowledgeManager.findGraphsWithTypeHierarchy()
private static void fillInGlossaryDefinitions(Graph g)
private static void addNewTypeLabels(Graph g)
g
using a crude heuristic for layout. If the type hierarchy
graph is actually changed (i.e., if there are really any new type labels
added) then its ownerframe (if any) is marked as changed and brought to
the front. NEED a routine to first find multi-word phrases and turn them
into their own types. NEED to also check relations!!g
- original graph to be modified in-place.private static boolean okayToAddTypeLabel(Concept c, ArrayList typelabelvector)
public static void linkTypeLabels(Graph h)
public static void linkHypernyms(TypeLabel t, net.didion.jwnl.data.Synset s, Graph h)
t
- original (possible subtype)s
- t's synset to begin with, or a recursively-obtained oneh
- the graph to restrict searchinglinkTypeLabels(charger.obj.Graph)
public static TypeLabel[] findBySynset(net.didion.jwnl.data.Synset s, Graph g)
s
- the synset whose GNode is sought.g
- the graph where the type label search is *
limited; null
if we want all type labels from all graphs.