com.github.chen0040.plsa.BasicDocument Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-plsa Show documentation
Show all versions of java-plsa Show documentation
Java implementation of probabilistic latent semantic analysis (pLSA)
The newest version!
package com.github.chen0040.plsa;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Created by xschen on 9/9/15.
*/
public class BasicDocument implements Document {
private final Map wordCounts;
private final List words;
private String text;
private int docIndex;
public BasicDocument(Map wordCounts, String text, int index){
this.wordCounts = wordCounts;
this.text = text;
this.docIndex = index;
this.words = new ArrayList<>(wordCounts.keySet());
}
public Map indexedWordCount(){
return wordCounts;
}
@Override public List wordIndices() {
return words;
}
public String content(){
return text;
}
public int docIndex(){
return docIndex;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy