mecab

package module
v0.0.0-...-d20cddd Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2015 License: MIT Imports: 2 Imported by: 2

README

mecab-go Build Status Coverage Status

MeCab binding for Go.

Original

Environment

  • os: mac os 10.10(yosemite)
  • mecab: install by homebrew

Install

go get github.com/yukihir0/mecab-go
cd cmd/mg
go install

Generate mecab_gen.go

mecab_gen.go is a generated file that is setuped cflags and ldflag for cgo.
It is a goal that can support multiple operating systems.

go generate

How to use

input := "すもももももももものうち"
result, err := mecab.Parse(input)

if err != nil {
	panic(err)
}

for _, r := range result {
	fmt.Println(r.Surface)
}

License

Copyright © 2015 yukihir0

Documentation

Overview

Package mecab : MeCab binding for Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParseResult

type ParseResult struct {
	Surface string // 表層形
	Feature string // 形態素
	Pos     string // 品詞
	Pos1    string // 品詞細分類1
	Pos2    string // 品詞細分類2
	Pos3    string // 品詞細分類3
	Cform   string // 活用形
	Ctype   string // 活用型
	Base    string // 原形
	Read    string // 読み
	Pron    string // 発音
}

ParseResult represents MeCab parse result.

func Parse

func Parse(sentence string) (r []ParseResult, err error)

Parse returns MeCab parse result.

Directories

Path Synopsis
cmd
mg command

Jump to

Keyboard shortcuts

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