Help us shape the future of Go! Take the 2026 Go Developer Survey

mythes

package module
v0.0.0-...-9befe64 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 6 Imported by: 0

README

go-mythes

Go wrapper for the MyThes library

Usage (on Ubuntu/Debian)

Install the library:

sudo apt install libmythes-1.2-0

Import the wrapper in your go application:

import (
    "github.com/spellchecker-lu/go-mythes"
)

Example usage:

var idxFile = "dic/th_xyz.idx"
var datFile = "dic/th_xyz.dat"

var mythesHandle = mythes.MyThes(idxFile, datFile)

synsets := mythesHandle.Lookup(strings.ToLower(word))
for _, synset := range synsets {
    log.Println(synset)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyThesHandle

type MyThesHandle struct {
	// contains filtered or unexported fields
}

Struct that holds a reference to the MyThes library

func MyThes

func MyThes(idxpath string, datpath string) *MyThesHandle

Initialize MyThes

func (*MyThesHandle) Lookup

func (handle *MyThesHandle) Lookup(word string) []Synset

Lookup synonyms for a word in a MyThes file

type Synset

type Synset struct {
	Label    string   `json:"label"`
	Synonyms []string `json:"synonyms"`
}

Struct that holds a single synonym set (made up of a definition (or label) and one or more synonyms.

Jump to

Keyboard shortcuts

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