c526a38369
ultimately this is make it more convenient for us to wire up different elements of the analysis pipeline, without having to preload everything into memory before we need it separately the index layer now has a mechanism for storing internal key/value pairs. this is expected to be used to store the mapping, and possibly other pieces of data by the top layer, but not exposed to the user at the top.
103 lines
1.4 KiB
Go
103 lines
1.4 KiB
Go
package el
|
||
|
||
import (
|
||
"github.com/couchbaselabs/bleve/analysis"
|
||
"github.com/couchbaselabs/bleve/registry"
|
||
)
|
||
|
||
const StopName = "stop_el"
|
||
|
||
// this content was obtained from:
|
||
// lucene-4.7.2/analysis/common/src/resources/org/apache/lucene/analysis/
|
||
// ` was changed to ' to allow for literal string
|
||
|
||
var GreekStopWords = []byte(`# Lucene Greek Stopwords list
|
||
# Note: by default this file is used after GreekLowerCaseFilter,
|
||
# so when modifying this file use 'σ' instead of 'ς'
|
||
ο
|
||
η
|
||
το
|
||
οι
|
||
τα
|
||
του
|
||
τησ
|
||
των
|
||
τον
|
||
την
|
||
και
|
||
κι
|
||
κ
|
||
ειμαι
|
||
εισαι
|
||
ειναι
|
||
ειμαστε
|
||
ειστε
|
||
στο
|
||
στον
|
||
στη
|
||
στην
|
||
μα
|
||
αλλα
|
||
απο
|
||
για
|
||
προσ
|
||
με
|
||
σε
|
||
ωσ
|
||
παρα
|
||
αντι
|
||
κατα
|
||
μετα
|
||
θα
|
||
να
|
||
δε
|
||
δεν
|
||
μη
|
||
μην
|
||
επι
|
||
ενω
|
||
εαν
|
||
αν
|
||
τοτε
|
||
που
|
||
πωσ
|
||
ποιοσ
|
||
ποια
|
||
ποιο
|
||
ποιοι
|
||
ποιεσ
|
||
ποιων
|
||
ποιουσ
|
||
αυτοσ
|
||
αυτη
|
||
αυτο
|
||
αυτοι
|
||
αυτων
|
||
αυτουσ
|
||
αυτεσ
|
||
αυτα
|
||
εκεινοσ
|
||
εκεινη
|
||
εκεινο
|
||
εκεινοι
|
||
εκεινεσ
|
||
εκεινα
|
||
εκεινων
|
||
εκεινουσ
|
||
οπωσ
|
||
ομωσ
|
||
ισωσ
|
||
οσο
|
||
οτι
|
||
`)
|
||
|
||
func TokenMapConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.TokenMap, error) {
|
||
rv := analysis.NewTokenMap()
|
||
err := rv.LoadBytes(GreekStopWords)
|
||
return rv, err
|
||
}
|
||
|
||
func init() {
|
||
registry.RegisterTokenMap(StopName, TokenMapConstructor)
|
||
}
|