dicttypes

package
v0.0.181 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 2 Imported by: 6

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Chinese-English dictionary type definitions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCJKChar added in v0.0.28

func IsCJKChar(character string) bool

IsCJKChar tests whether the symbol is a CJK character, excluding punctuation Only looks at the first charater in the string

func NormalizePinyin added in v0.0.92

func NormalizePinyin(pinyin string) string

Removes the tone diacritics from a Pinyin string

Types

type DictionaryConfig added in v0.0.23

type DictionaryConfig struct {
	AvoidSubDomains map[string]bool
	DictionaryDir   string
}

DictionaryConfig encapsulates parameters for dictionary configuration

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

func (Word) HasNotesLabel added in v0.0.51

func (w Word) HasNotesLabel(label string) bool

HasNotesLabel tests whether the term has a label with the given value.

func (Word) IsProperNoun added in v0.0.21

func (w Word) IsProperNoun() 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.

func (Word) IsQuote added in v0.0.46

func (w Word) IsQuote() bool

IsQuote tests whether the term is a quotation. Note for quotations are prefixed by Quote:

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 WordSenses added in v0.0.22

type WordSenses []WordSense

May be sorted into descending order with most frequent bigram first

func (WordSenses) Len added in v0.0.22

func (senses WordSenses) Len() int

func (WordSenses) Less added in v0.0.22

func (senses WordSenses) Less(i, j int) bool

func (WordSenses) Swap added in v0.0.22

func (senses WordSenses) Swap(i, j int)

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