zh

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Current *gorm.DB
}

DB holds storage for current DB

func Connect

func Connect() DB

Connect connects to the database

type Sentence

type Sentence struct {
	ID        int `gorm:"primaryKey"`
	Chinese   string
	Pinyin    string
	English   string
	Frequency float64
	Level     float64
}

Sentence represents Tatoeba sentence repository

type Token

type Token struct {
	Entry      string `gorm:"primaryKey"`
	Pinyin     string
	English    string
	Frequency  float64
	HanziLevel int
	VocabLevel int

	Sub      []Token `gorm:"many2many:token_sub"`
	Sup      []Token `gorm:"many2many:token_sup"`
	Variants []Token `gorm:"many2many:token_var"`
}

Token represents Token frequency and parts table

type TokenSub

type TokenSub struct {
	Parent      string `gorm:"primaryKey"`
	Child       string `gorm:"primaryKey"`
	ParentToken Token  `gorm:"foreignKey:Parent"`
	ChildToken  Token  `gorm:"foreignKey:Child"`
}

TokenSub is self-referential table for sub @internal

type TokenSup

type TokenSup struct {
	Parent      string `gorm:"primaryKey"`
	Child       string `gorm:"primaryKey"`
	ParentToken Token  `gorm:"foreignKey:Parent"`
	ChildToken  Token  `gorm:"foreignKey:Child"`
}

TokenSup is self-referential table for sup @internal

type TokenVar

type TokenVar struct {
	Parent      string `gorm:"primaryKey"`
	Child       string `gorm:"primaryKey"`
	ParentToken Token  `gorm:"foreignKey:Parent"`
	ChildToken  Token  `gorm:"foreignKey:Child"`
}

TokenVar is self-referential table for variants @internal

type Vocab

type Vocab struct {
	Simplified  string
	Traditional string
	Pinyin      string
	English     string
	Frequency   float64
	Source      string
}

Vocab represents MDBG CEDict and extras

Jump to

Keyboard shortcuts

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