@Test public void pageRankTest() { PageRank textRank = new PageRank(); FlexCompColMatrix adjacentMatrix = new FlexCompColMatrix(22, 22); String[] nameArray = new String[] { "systems", "compatibility", "criteria", "numbers", "natural", "types", "linear", "system", "diophantine", "constraints", "equations", "strict", "inequations", "nonstrict", "upper", "bounds", "components", "minimal", "construction", "algorithms", "solutions", "sets" }; connect(adjacentMatrix,0,1); connect(adjacentMatrix,0,5); connect(adjacentMatrix,0,6); connect(adjacentMatrix,1,2); connect(adjacentMatrix,2,3); connect(adjacentMatrix,2,4); connect(adjacentMatrix,3,4); connect(adjacentMatrix,5,20); connect(adjacentMatrix,6,7); connect(adjacentMatrix,6,8); connect(adjacentMatrix,6,9); connect(adjacentMatrix,6,10); connect(adjacentMatrix,10,11); connect(adjacentMatrix,11,12); connect(adjacentMatrix,12,13); connect(adjacentMatrix,14,15); connect(adjacentMatrix,15,16); connect(adjacentMatrix,16,17); connect(adjacentMatrix,17,18); connect(adjacentMatrix,17,21); connect(adjacentMatrix,18,19); connect(adjacentMatrix,19,20); connect(adjacentMatrix,21,20); double d = 0.85; double threshold = 0.0001; Vector degreeVector = textRank.getDegreeVector(22, adjacentMatrix); Vector scoreVector = textRank.initScoreVector(22); DenseVector biasVector = textRank.createPreferenceVector(22, d); FlexCompColMatrix transitionMatrix = textRank.createTransitionMatrix(adjacentMatrix, degreeVector, 22); textRank.nodeRank(transitionMatrix, d, biasVector, scoreVector, threshold); Map<String,Double> results = new HashMap<String,Double>(); for(int i = 0; i < nameArray.length ; i++) { results.put(nameArray[i], scoreVector.get(i)); } System.out.println(results); }
public PageRank() { }
PageRank { public PageRank() { } }
PageRank { public PageRank() { } PageRank();  PageRank(Map<String, Integer> termMap, Map<Integer, Set<Integer>> neighborMap); }
PageRank { public PageRank() { } PageRank();  PageRank(Map<String, Integer> termMap, Map<Integer, Set<Integer>> neighborMap); void initializeFromDisambiguationCollection(Collection<Disambiguation> disambiguations); void initializeFromIterator(FSIterator<Annotation> wpIterator, FSIterator<Annotation> srIterator, boolean weighted); void initializeFromAnnotationPairIterator(Collection<AnnotationPair> pairs, boolean weighted); void run(); List<TermRank> getTermRanks(); int getMaxRuns(); void setMaxRuns(int maxRuns); }
PageRank { public PageRank() { } PageRank();  PageRank(Map<String, Integer> termMap, Map<Integer, Set<Integer>> neighborMap); void initializeFromDisambiguationCollection(Collection<Disambiguation> disambiguations); void initializeFromIterator(FSIterator<Annotation> wpIterator, FSIterator<Annotation> srIterator, boolean weighted); void initializeFromAnnotationPairIterator(Collection<AnnotationPair> pairs, boolean weighted); void run(); List<TermRank> getTermRanks(); int getMaxRuns(); void setMaxRuns(int maxRuns);  }