abbr

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abbr

func Abbr(s string) string

Abbr returns the "long" abbreviation of a string. For example, "Journal of the Linnean Society" becomes "jotls". such short strings are used with the Aho-Corasick algorithm to find matches of journal titles in a reference to the titles in the BHL database.

func AbbrMax

func AbbrMax(s string, shortWords map[string]struct{}) string

AbbrMax abbreviates a string ignoring common short words. For example, "Journal of the Linnean Society" becomes "jls". Such abbreviations are used with the Aho-Corasick algorithm to find matches of journal titles in a reference to the titles in the BHL database.

func Patterns

func Patterns(s string, d map[string]struct{}) []string

Patterns returns a list of possible abbreviations of a string. It uses two methods to abbreviate the string: Abbr and AbbrMax. The first method abbreviates the string without any restrictions, while the second method ignores common short words. The result is a list of abbreviations and their derivatives.

func ShorterStrings added in v0.2.2

func ShorterStrings(s string) []string

ShorterStrings adds appropriate shortened versions of a string. It is helpful for matching shortened versions of titles from references.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL