Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFilter = Filter{MinLength: 2, MaxLength: 0, PreferLongestNonOverlapping: false}
Default filter ignores single character words. If you want to include them, set MinLength to 1.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
MinLength int // Minimum word length (inclusive)
MaxLength int // Maximum word length (inclusive, 0 means no limit)
ExactLength int // Exact word length (0 means no exact match required)
PreferLongestNonOverlapping bool // Prefer longest non-overlapping matches. e.g. "hello" vs "hell"
}
Filter defines criteria for filtering words
type Match ¶
type Match struct {
Word string `json:"word"`
StartPos int `json:"start_pos"`
EndPos int `json:"end_pos"`
}
Match represents a found word match
type Result ¶
type Result struct {
WordCount int `json:"word_count"`
UniqueWords []string `json:"unique_words"`
Matches []Match `json:"matches"`
}
Result represents the result of English word detection
type Searcher ¶
type Searcher struct {
// contains filtered or unexported fields
}
Searcher provides nltk English word detection with configurable filters
func NewSearcher ¶
NewSearcher creates a new searcher with the specified word filters
func (*Searcher) GetWordCount ¶
GetWordCount returns the number of words in this searcher's dictionary
Click to show internal directories.
Click to hide internal directories.