analysis

package
v0.0.0-...-27f001b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright (c) 2014 Couchbase, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2014 Couchbase, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2014 Couchbase, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2014 Couchbase, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var INVALID_DATETIME = fmt.Errorf("unable to parse datetime with any of the layouts")

Functions

func BuildTermFromRunes

func BuildTermFromRunes(runes []rune) []byte

func DeleteRune

func DeleteRune(in []rune, pos int) []rune

func InsertRune

func InsertRune(in []rune, pos int, r rune) []rune

func TruncateRunes

func TruncateRunes(input []byte, num int) []byte

Types

type Analyzer

type Analyzer struct {
	CharFilters  []CharFilter
	Tokenizer    Tokenizer
	TokenFilters []TokenFilter
}

func (*Analyzer) Analyze

func (a *Analyzer) Analyze(input []byte) TokenStream

type CharFilter

type CharFilter interface {
	Filter([]byte) []byte
}

type DateTimeParser

type DateTimeParser interface {
	ParseDateTime(string) (time.Time, error)
}

type Token

type Token struct {
	Start    int
	End      int
	Term     []byte
	Position int
	Type     TokenType
	KeyWord  bool
}

func (*Token) String

func (t *Token) String() string

type TokenFilter

type TokenFilter interface {
	Filter(TokenStream) TokenStream
}

type TokenFreq

type TokenFreq struct {
	Term      []byte
	Locations []*TokenLocation
}

type TokenFrequencies

type TokenFrequencies []*TokenFreq

func TokenFrequency

func TokenFrequency(tokens TokenStream) TokenFrequencies

func (TokenFrequencies) MergeAll

func (tfs TokenFrequencies) MergeAll(remoteField string, other TokenFrequencies) TokenFrequencies

type TokenLocation

type TokenLocation struct {
	Field    string
	Start    int
	End      int
	Position int
}

type TokenMap

type TokenMap map[string]bool

func NewTokenMap

func NewTokenMap() TokenMap

func (TokenMap) AddToken

func (t TokenMap) AddToken(token string)

func (TokenMap) LoadBytes

func (t TokenMap) LoadBytes(data []byte) error

func (TokenMap) LoadFile

func (s TokenMap) LoadFile(filename string) error

func (TokenMap) LoadLine

func (t TokenMap) LoadLine(line string) error

type TokenStream

type TokenStream []*Token

type TokenType

type TokenType int
const (
	AlphaNumeric TokenType = iota
	Numeric
	DateTime
)

type Tokenizer

type Tokenizer interface {
	Tokenize([]byte) TokenStream
}

Directories

Path Synopsis
analyzers
detect_lang_analyzer
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
keyword_analyzer
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
simple_analyzer
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
standard_analyzer
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
char_filters
html_char_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
regexp_char_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
zero_width_non_joiner
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
datetime_parsers
datetime_optional
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
flexible_go
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
language
ar
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
bg
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
ca
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
ckb
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
cs
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
da
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
de
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
el
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
en
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
es
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
eu
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
fa
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
fi
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
fr
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
ga
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
gl
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
hi
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
hu
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
hy
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
id
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
it
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
nl
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
no
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
porter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
pt
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
ro
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
ru
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
sv
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
th
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
tr
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
token_filters
apostrophe_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
cld2
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
edge_ngram_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
elision_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
keyword_marker_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
length_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
lower_case_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
ngram_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
stemmer_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
stop_tokens_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
truncate_token_filter
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
unicode_normalize
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
tokenizers
regexp_tokenizer
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
single_token
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
unicode_word_boundary
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.
whitespace_tokenizer
Copyright (c) 2014 Couchbase, Inc.
Copyright (c) 2014 Couchbase, Inc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳