Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/koron/gomigemo

Go/Migemo implementation
https://github.com/koron/gomigemo

go golang

Last synced: about 12 hours ago
JSON representation

Go/Migemo implementation

Awesome Lists containing this project

README

        

# Go/Migemo module

[![PkgGoDev](https://pkg.go.dev/badge/github.com/koron/gomigemo)](https://pkg.go.dev/github.com/koron/gomigemo)
[![Actions/Go](https://github.com/koron/gomigemo/workflows/Go/badge.svg)](https://github.com/koron/gomigemo/actions?query=workflow%3AGo)
[![Go Report Card](https://goreportcard.com/badge/github.com/koron/gomigemo)](https://goreportcard.com/report/github.com/koron/gomigemo)

## Install and Update

```console
$ go get github.com/koron/gomigemo@latest
```

## Usage

To load dictionary files from file system:

```go
// Import migemo package.
import "github.com/koron/gomigemo/migemo"

// Load dictionary files.
dict, err := migemo.LoadDefault()

// Compile to get *regexp.Regexp.
re, err := migemo.Compile(dict, "aiueo")
```

To embedded dictionary to the executable file:

```go
// Import migemo and embedict package.
import (
"github.com/koron/gomigemo/embedict"
"github.com/koron/gomigemo/migemo"
)

// Load embedded dictionary.
dict, err := embedict.Load()

// Compile to get *regexp.Regexp.
re, err := migemo.Compile(dict, "aiueo")
```

## LICENSE

Distributed under MIT License,
except for `_dict/SKK-JISYO.utf-8.L` and `embedict/bindata.go` which is GPL.

See LICENSE.