dicttypes

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 1 Imported by: 6

Documentation

Overview

Chinese-English dictionary type definitions

Index

Constants

This section is empty.

Variables

View Source
var NORMAL = map[rune]rune{
	'ā': 'a',
	'á': 'a',
	'ǎ': 'a',
	'à': 'a',
	'ē': 'e',
	'é': 'e',
	'ě': 'e',
	'è': 'e',
	'ī': 'i',
	'í': 'i',
	'ǐ': 'i',
	'ì': 'i',
	'ō': 'o',
	'ó': 'o',
	'ǒ': 'o',
	'ò': 'o',
	'ū': 'u',
	'ú': 'u',
	'ǔ': 'u',
	'ù': 'u',
	'Ā': 'a',
	'Á': 'a',
	'Ǎ': 'a',
	'À': 'a',
	'Ē': 'e',
	'É': 'e',
	'Ě': 'e',
	'È': 'e',
	'Ī': 'i',
	'Í': 'i',
	'Ǐ': 'i',
	'Ì': 'i',
	'Ō': 'o',
	'Ó': 'o',
	'Ǒ': 'o',
	'Ò': 'o',
	'Ū': 'u',
	'Ú': 'u',
	'Ǔ': 'u',
	'Ù': 'u',
}

Functions

func IsProperNoun added in v0.0.18

func IsProperNoun(w *Word) bool

IsProperNoun tests whether the word is a proper noun. If the majority of word senses are proper nouns, then the word is marked as a proper noun.

Types

type Word

type Word struct {
	Simplified, Traditional, Pinyin string
	HeadwordId                      int
	Senses                          []WordSense
}

A top level word structure that may include multiple word senses

func CloneWord added in v0.0.18

func CloneWord(w Word) Word

Clones the headword definition without the attached array of word senses

type WordSense

type WordSense struct {
	Id, HeadwordId int
	Simplified, Traditional, Pinyin, English, Grammar, Concept, ConceptCN, Domain,
	DomainCN, Subdomain, SubdomainCN, Image, MP3, Notes string
}

Defines a single sense of a Chinese word

func (*WordSense) IsFunctionWord added in v0.0.19

func (ws *WordSense) IsFunctionWord() bool

Tests whether the word is a function word

type Words added in v0.0.20

type Words []Word

May be sorted into descending order with most frequent bigram first

func (Words) Len added in v0.0.20

func (hwArr Words) Len() int

func (Words) Less added in v0.0.20

func (hwArr Words) Less(i, j int) bool

func (Words) Swap added in v0.0.20

func (hwArr Words) Swap(i, j int)

Jump to

Keyboard shortcuts

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