r78367 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78366‎ | r78367 | r78368 >
Date:11:21, 14 December 2010
Author:daniel
Status:deferred
Tags:
Comment:
use String keys for known concept interpretations
Modified paths:
  • /trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/disambig/AbstractDisambiguator.java (modified) (history)
  • /trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/disambig/CoherenceDisambiguator.java (modified) (history)
  • /trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/disambig/Disambiguator.java (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/disambig/CoherenceDisambiguator.java
@@ -21,7 +21,6 @@
2222 import de.brightbyte.data.measure.Similarity;
2323 import de.brightbyte.util.PersistenceException;
2424 import de.brightbyte.util.SanityException;
25 -import de.brightbyte.wikiword.disambig.Disambiguator.Disambiguation;
2625 import de.brightbyte.wikiword.model.ConceptFeatures;
2726 import de.brightbyte.wikiword.model.PhraseNode;
2827 import de.brightbyte.wikiword.model.TermReference;
@@ -271,7 +270,7 @@
272271 return getBestInterpretation(root, meanings, context, interpretations, similarities, features);
273272 }
274273
275 - protected <X extends TermReference>Map<X, List<? extends C>> getMeanings(Collection<X> terms, Map<X, C> known) throws PersistenceException {
 274+ protected <X extends TermReference>Map<X, List<? extends C>> getMeanings(Collection<X> terms, Map<String, C> known) throws PersistenceException {
276275 Map<X, List<? extends C>> meanings = super.getMeanings(terms, known);
277276 pruneMeanings(meanings);
278277 return meanings;
Index: trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/disambig/AbstractDisambiguator.java
@@ -100,12 +100,12 @@
101101 }
102102 }
103103
104 - protected <X extends TermReference>Map<X, List<? extends C>> getMeanings(PhraseNode<X> root, Map<X, C> known) throws PersistenceException {
 104+ protected <X extends TermReference>Map<X, List<? extends C>> getMeanings(PhraseNode<X> root, Map<String, C> known) throws PersistenceException {
105105 Collection<X> terms = getTerms(root, Integer.MAX_VALUE);
106106 return getMeanings(terms, known);
107107 }
108108
109 - protected <X extends TermReference>Map<X, List<? extends C>> getMeanings(Collection<X> terms, Map<X, C> known) throws PersistenceException {
 109+ protected <X extends TermReference>Map<X, List<? extends C>> getMeanings(Collection<X> terms, Map<String, C> known) throws PersistenceException {
110110 Collection<X> todo = terms;
111111
112112 if (meaningOverrides!=null || known!=null) {
@@ -139,13 +139,13 @@
140140 return meanings;
141141 }
142142
143 - public <X extends TermReference>Disambiguation<X, C> disambiguate(List<X> terms, Map<X, C> known, Collection<? extends C> context) throws PersistenceException {
 143+ public <X extends TermReference>Disambiguation<X, C> disambiguate(List<X> terms, Map<String, C> known, Collection<? extends C> context) throws PersistenceException {
144144 PhraseNode<X> root = new TermListNode<X>(terms, 0);
145145 Map<X, List<? extends C>> meanings = getMeanings(terms, known);
146146 return doDisambiguate(root, meanings, context);
147147 }
148148
149 - public <X extends TermReference>Disambiguation<X, C> disambiguate(PhraseNode<X> root, Map<X, C> known, Collection<? extends C> context) throws PersistenceException {
 149+ public <X extends TermReference>Disambiguation<X, C> disambiguate(PhraseNode<X> root, Map<String, C> known, Collection<? extends C> context) throws PersistenceException {
150150 Collection<X> terms = getTerms(root, Integer.MAX_VALUE);
151151 Map<X, List<? extends C>> meanings = getMeanings(terms, known);
152152 return doDisambiguate(root, meanings, context);
Index: trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/disambig/Disambiguator.java
@@ -166,8 +166,8 @@
167167
168168 public void setTrace(Output trace);
169169
170 - public <X extends TermReference>Disambiguation<X, C> disambiguate(List<X> terms, Map<X, C> known, Collection<? extends C> context) throws PersistenceException;
171 - public <X extends TermReference>Disambiguation<X, C> disambiguate(PhraseNode<X> root, Map<X, C> known, Collection<? extends C> context) throws PersistenceException;
 170+ public <X extends TermReference>Disambiguation<X, C> disambiguate(List<X> terms, Map<String, C> known, Collection<? extends C> context) throws PersistenceException;
 171+ public <X extends TermReference>Disambiguation<X, C> disambiguate(PhraseNode<X> root, Map<String, C> known, Collection<? extends C> context) throws PersistenceException;
172172
173173 public boolean exploresAllSequences();
174174

Status & tagging log