Documentation ¶
Overview ¶
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Copyright 2015 Mathieu MAST. All rights reserved. Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Index ¶
- func Abs(a int) int
- func Clean(source string, stopWords container.Container) string
- func CompareScoreResult(r1, r2 interface{}) int
- func ContainerScore(searchWords container.Container, reference string) int
- func DefaultFilter(result *Result) bool
- func Distance(search, reference string) int
- func GobRegister()
- func MSplit(source string) container.Container
- func Max(a int, b int) int
- func Min(a int, b int) int
- func Partialphone(source string) string
- func PartialphoneWriteLast(b *bytes.Buffer, ptrCurrentRune, ptrLastRune, ptrPenultimateRune *rune)
- func Split(source string) container.Container
- func StrScore(search string, reference string) int
- func UpperUnaccentUnpunctRune(r rune) rune
- func UpperUnaccentUnpunctString(str string) string
- type Bound
- type ConcurrentSniffer
- type Filter
- type Index
- type Location
- type Memindex
- func (mi *Memindex) Add(locs ...Location)
- func (mi *Memindex) AddStopWord(words ...string)
- func (mi *Memindex) Clear()
- func (mi *Memindex) Get(id string) Location
- func (mi *Memindex) GetEncodedStopWords() container.Container
- func (mi *Memindex) GetIds(key string) container.Container
- func (mi *Memindex) GetNbIds(key string) int
- func (mi *Memindex) GetStopWords() container.Container
- func (mi *Memindex) SaveInFile(filename string)
- func (mi *Memindex) Search(parameters Parameters) (container.Container, error)
- type NumberedPoint
- type NumberedPointBag
- type Parameters
- type Poi
- func (p *Poi) GetCleanedName() string
- func (p *Poi) GetEncodedName() string
- func (p *Poi) GetId() string
- func (p *Poi) GetLat() float32
- func (p *Poi) GetLon() float32
- func (p *Poi) GetName() string
- func (p *Poi) GetType() string
- func (p *Poi) SetCleanedName(cleanedName string)
- func (p *Poi) SetEncodedName(encodedName string)
- type Point
- type Result
- type Sniffer
- type Street
- func (s *Street) AddNumberedPoint(numberedPoint *StreetNumberedPoint)
- func (s *Street) GetCleanedName() string
- func (s *Street) GetEncodedName() string
- func (s *Street) GetId() string
- func (s *Street) GetLat() float32
- func (s *Street) GetLon() float32
- func (s *Street) GetName() string
- func (s *Street) GetNumberedPoints() container.Container
- func (s *Street) GetType() string
- func (s *Street) SetCleanedName(cleanedName string)
- func (s *Street) SetEncodedName(encodedName string)
- type StreetNumberedPoint
- type Zone
- func (z *Zone) GetCleanedName() string
- func (z *Zone) GetEncodedName() string
- func (z *Zone) GetId() string
- func (z *Zone) GetLat() float32
- func (z *Zone) GetLon() float32
- func (z *Zone) GetName() string
- func (z *Zone) GetType() string
- func (z *Zone) SetCleanedName(cleanedName string)
- func (z *Zone) SetEncodedName(encodedName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareScoreResult ¶
func CompareScoreResult(r1, r2 interface{}) int
func DefaultFilter ¶
func GobRegister ¶
func GobRegister()
func Partialphone ¶
func PartialphoneWriteLast ¶
Types ¶
type ConcurrentSniffer ¶
type ConcurrentSniffer struct {
// contains filtered or unexported fields
}
func NewConcurrentSniffer ¶
func NewConcurrentSniffer(index Index) *ConcurrentSniffer
func (*ConcurrentSniffer) Search ¶
func (s *ConcurrentSniffer) Search(parameters Parameters) (container.Container, error)
type Index ¶
type Index interface { Sniffer // Add new locations Add(...Location) // Get location Get(string) Location // Get ids number for key GetNbIds(string) int // // Get ids for key GetIds(string) container.Container // Add new stop word AddStopWord(...string) // Get stop words GetStopWords() container.Container // Get encoded stop words GetEncodedStopWords() container.Container }
type Location ¶
type Location interface { // Get unique identifier. GetId() string // Get cleaned name GetCleanedName() string // Set cleaned name SetCleanedName(string) // Get phonetic encoded name GetEncodedName() string // Set phonetic encoded name SetEncodedName(string) // Get name to indexing it. GetName() string // Get type (street, poi, zone...). GetType() string // Get latitude GetLat() float32 // Get lLongitude GetLon() float32 }
Location definition.
type Memindex ¶
type Memindex struct { Locations *container.Map Keys *container.Map StopWords *container.Set EncodedStopWords *container.Set // contains filtered or unexported fields }
func NewMemindex ¶
func NewMemindex() *Memindex
func NewMemindexFromFile ¶
func (*Memindex) AddStopWord ¶
func (*Memindex) GetEncodedStopWords ¶
func (*Memindex) GetStopWords ¶
func (*Memindex) SaveInFile ¶
type NumberedPoint ¶
type NumberedPoint interface { // Get string number GetNumber() string // Get latitude GetLat() float32 // Get longitude GetLon() float32 }
Numbered point definition.
type NumberedPointBag ¶
Numbered definition.
type Parameters ¶
type Parameters map[string]interface{}
type Poi ¶
type Poi struct { Id string EncodedName string CleanedName string PoiName string PoiType string Zone *Zone Point }
func (*Poi) GetCleanedName ¶
func (*Poi) GetEncodedName ¶
func (*Poi) SetCleanedName ¶
func (*Poi) SetEncodedName ¶
type Street ¶
type Street struct { Id string EncodedName string CleanedName string StreetName string Zone *Zone Point NumberedPoints *container.LinkedList }
func (*Street) AddNumberedPoint ¶
func (s *Street) AddNumberedPoint(numberedPoint *StreetNumberedPoint)
func (*Street) GetCleanedName ¶
func (*Street) GetEncodedName ¶
func (*Street) GetNumberedPoints ¶
func (*Street) SetCleanedName ¶
func (*Street) SetEncodedName ¶
type StreetNumberedPoint ¶
func NewStreetNumberedPoint ¶
func NewStreetNumberedPoint(number string, lat float32, lon float32) *StreetNumberedPoint
func (*StreetNumberedPoint) GetLat ¶
func (np *StreetNumberedPoint) GetLat() float32
func (*StreetNumberedPoint) GetLon ¶
func (np *StreetNumberedPoint) GetLon() float32
func (*StreetNumberedPoint) GetNumber ¶
func (np *StreetNumberedPoint) GetNumber() string