Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultDataset = "/company_designator.yml" StrBeginBefore = `^\pZ*` StrBeginAfter = `[\pZ\pP]\pZ*(.+?)\pZ*$` StrEndBefore = `^\pZ*(.+?)\pZ*([\pZ\pP])\pZ*` StrEndAfter = `\pZ*$` StrEndContBefore = `^\pZ*(.+?)\pZ*` StrEndContAfter = `\pZ*$` )
Variables ¶
View Source
var EndDesignatorBlacklist = map[string]bool{ "Vennootschap": true, "L.L.C.": true, "L.C.": true, "Co.": true, "Co. L.L.C.": true, }
The standard/perl RE engine in Go doesn't use POSIX-style longest match semantics, which bites us where we have proper subset alternates e.g. `Vennootschap` vs `Vennootschap Onder Firma`. We can workaround this by blacklisting the shorter variant and doing a second pass match if the first one fails.
In languages with continuous scripts, we don't require a word break ([\pZ\pP] before/after designators
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
type PositionType ¶
type PositionType int
const ( None PositionType = iota End EndFallback EndCont Begin BeginFallback )
func (PositionType) String ¶
func (p PositionType) String() string
type Result ¶
type Result struct { Input string // Initial input string Matched bool // True if a Designator was found ShortName string // Input with any matched Designator removed Designator string // The Designator found in input, if any (verbatim) Position PositionType // The Designator position, if found }
Click to show internal directories.
Click to hide internal directories.