コード例 #1
0
ファイル: lattice.go プロジェクト: shogo82148/go-mecab
func NewLattice() (Lattice, error) {
	lattice := C.mecab_lattice_new()

	if lattice == nil {
		return Lattice{}, errors.New("mecab_lattice is not created")
	}
	return Lattice{lattice: lattice}, nil
}
コード例 #2
0
ファイル: lattice.go プロジェクト: mkitawaki/mecab-go
// New is a function to return create new lattice object
func New() (*Lattice, error) {
	return newLattice(C.mecab_lattice_new())
}