Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
ポスティングリストをたどるためのカーソル
func (*Cursor) DocId ¶
func (c *Cursor) DocId() DocumentID
func (*Cursor) NextDoc ¶
func (c *Cursor) NextDoc(id DocumentID)
type DocumentStore ¶
type DocumentStore struct {
// contains filtered or unexported fields
}
func NewDocumentStore ¶
func NewDocumentStore(db *sql.DB) *DocumentStore
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
検索エンジン
func (*Engine) AddDocument ¶
インデックスにドキュメントを追加する
type Index ¶
type Index struct { Dictionary map[string]PostingsList // 辞書 TotalDocsCount int // ドキュメントの総数 }
転地インデックス 注意: mapを使用しているのでマルチスレッドには対応していない
type IndexReader ¶
type IndexReader struct {
// contains filtered or unexported fields
}
func NewIndexReader ¶
func NewIndexReader(path string) *IndexReader
type IndexWriter ¶
type IndexWriter struct {
// contains filtered or unexported fields
}
func NewIndexWriter ¶
func NewIndexWriter(path string) *IndexWriter
type Posting ¶
type Posting struct { DocID DocumentID // ドキュメントID Positions []int // 用語の出現位置 TermFrequency int // ドキュメント内の用語の出現回数 }
ポスティング
type PostingsList ¶
ポスティングリスト
func (PostingsList) Add ¶
func (pl PostingsList) Add(new *Posting)
ポスティングをリストに追加 ポスティングリストの最後を取得してドキュメントIDが 一致していなければ、ポスティングを追加 一致していれば、positionを追加
func (PostingsList) MarshalJSON ¶
func (pl PostingsList) MarshalJSON() ([]byte, error)
func (PostingsList) OpenCursor ¶
func (pl PostingsList) OpenCursor() *Cursor
func (PostingsList) String ¶
func (pl PostingsList) String() string
func (*PostingsList) UnmarshalJSON ¶
func (pl *PostingsList) UnmarshalJSON(b []byte) error
type ScoreDoc ¶
type ScoreDoc struct {
// contains filtered or unexported fields
}
ドキュメントIDそのドキュメントのスコアを保持する
type SearchResult ¶
type SearchResult struct { DocID DocumentID Score float64 Title string }
検索結果を格納する構造体
func (*SearchResult) String ¶
func (r *SearchResult) String() string
String print SearchTopK result info
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
検索処理に必要なデータを保持する
func NewSearcher ¶
type Tokenizer ¶
type Tokenizer struct{}
func NewTokenizer ¶
func NewTokenizer() *Tokenizer
func (*Tokenizer) TextToWordSequence ¶
文字列を分解する処理
Source Files ¶
Click to show internal directories.
Click to hide internal directories.