INNER CODE UNIT · Go

findDefintion

wader/fq · format/ebml/gen/main.go:79

func findDefintion(docs []Documentation) (string, bool) {
	for _, d := range docs {
		if d.Purpose == "definition" {
			s := d.Value
			s = doubleParanRE.ReplaceAllLiteralString(s, "")
			s = longParanRE.ReplaceAllLiteralString(s, "")
			s = refsRE.ReplaceAllString(s, "$1")
			s = whitespaceRE.ReplaceAllLiteralString(s, " ")
			s = quotesRE.ReplaceAllLiteralString(s, "")
			s = strings.TrimRight(s, " .")
			s = strings.TrimLeft(s, " ")

			if i := strings.IndexAny(s, ".,;"); i != -1 {
				s = s[0:i]
			}

			return s, true
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…