Documentation
¶
Overview ¶
Package textmatch compares titles and names across sources and the metadata catalogue: every site writes a title its own way (case, width, accents, punctuation, word order of names). It normalizes the same way the metadata service does, so both agree on what "the same title" is.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Best ¶
Best returns the best similarity between any of as and any of bs, and the pair that scored it.
func Normalize ¶
Normalize folds compatibility forms (full-width Latin, half-width kana), removes diacritics, lowercases, drops apostrophes, turns other punctuation into spaces and collapses spaces.
func PeopleOverlap ¶
PeopleOverlap reports whether any name in as is the same person as any in bs.
func SameName ¶
SameName reports whether two person names are the same person as far as text tells: the same words in any order ("Akira Toriyama" and "Toriyama Akira"), or one written without spaces.
func Similarity ¶
Similarity scores how alike two titles are, from 0 to 1: 1 when they normalize the same; otherwise the best of an edit-distance ratio and a word-set ratio (which forgives reordered or extra words such as a subtitle on one side).
Types ¶
This section is empty.