|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectnet.trialpc.sticktools.model.AbstractLangModel
net.trialpc.sticktools.model.WrapModel<T>
net.trialpc.sticktools.model.DocCollection<T>
T
- public class DocCollection<T extends DocumentModel>
基本となる文書集合モデルのクラスです。 このクラスは、必ず文書モデルクラスをラッピングするように設計されています。
WrapModel
,
LangModels.EMPTY_COLLECTION
,
直列化された形式フィールドの概要 |
---|
クラス net.trialpc.sticktools.model.WrapModel から継承されたフィールド |
---|
listeners |
コンストラクタの概要 | |
---|---|
DocCollection()
空の DocCollection インスタンスを生成します。 |
メソッドの概要 | ||
---|---|---|
boolean |
addDocument(T d)
文書モデルを追加します。 |
|
void |
addDocumentAll(java.util.Collection<T> c)
複数の文書モデルを追加します。 |
|
boolean |
containsDocument(java.lang.String docid)
指定した文書 ID をもつ文書モデルが文書集合モデルに存在しているかどうかを返します。 |
|
boolean |
containsDocument(T d)
文書モデルが文書集合モデルに存在しているかどうかを返します。 |
|
int |
documentFrequency(java.lang.String term)
文書頻度を返します。 |
|
protected java.util.Set<T> |
getChildrenModels()
ラッピングしている言語モデルのセットを返します。 |
|
T |
getDocument(java.lang.String id)
指定した文書 ID を持つ文書モデルを返します。 |
|
java.util.Set<T> |
getInvertedList(java.lang.String term)
転置リストを返します。 |
|
java.util.Iterator<T> |
iterator()
文書モデルを返すイテレータです。 |
|
static
|
unmodifiableInstance(DocCollection<T> o)
変更不可能な文書集合インスタンスを返します。 |
クラス net.trialpc.sticktools.model.WrapModel から継承されたメソッド |
---|
addChildModel, addChildModelAll, addListener, castCollection, equals, getVocabulary, hashCode, isModifiable, numOfTerms, stateChanged, termCount |
クラス net.trialpc.sticktools.model.AbstractLangModel から継承されたメソッド |
---|
containsTerm, containsTerms, contaisQueries, numOfVocabulary, termFrequency, toString |
クラス java.lang.Object から継承されたメソッド |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
コンストラクタの詳細 |
---|
public DocCollection()
DocCollection
インスタンスを生成します。
メソッドの詳細 |
---|
public boolean addDocument(T d)
d
- 文書モデル
true
java.lang.NullPointerException
- d
が null
である場合public void addDocumentAll(java.util.Collection<T> c)
addDocument(DocumentModel)
に依存しています。
c
- 文書モデルを含むコレクションpublic T getDocument(java.lang.String id)
id
- 文書 ID
public boolean containsDocument(T d)
d
- 文書モデル
public boolean containsDocument(java.lang.String docid)
docid
- 文書 ID
public int documentFrequency(java.lang.String term)
文書頻度を返します。
文書頻度 (document frequency; DF) とは、語 term
の含まれる文書の数のことを指します。
この実装では、term
が null
のときは 0 を返します。
このメソッドで返される値の逆数の log
を計算することで、
idf を求めることができます。
term
- 頻度を求める単語
term
を含む文書数public java.util.Set<T> getInvertedList(java.lang.String term)
term
- 語
term
に対応した転置リストpublic static <T extends DocumentModel> DocCollection<T> unmodifiableInstance(DocCollection<T> o)
T
- 文書集合の型o
- 文書集合インスタンス
protected java.util.Set<T> getChildrenModels()
WrapModel
の記述:
WrapModel<T extends DocumentModel>
内の getChildrenModels
public java.util.Iterator<T> iterator()
java.lang.Iterable<T extends DocumentModel>
内の iterator
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |