英文:
Is there mmseg in Go or can I call a self-defined C function from Go?
问题
我想在Go中像其他语言一样使用mmseg,例如,在Python中,您可以使用pymmseg。
那么,是否有类似的Go包?
或者,我如何从Go调用C函数?
或者,我如何像在Python中那样从Go调用共享库(*.so)?
英文:
I want to use mmseg in Go as in other languages, for example, in python you can use pymmseg
So, is there is a similar Go package?
Or, how can I call the C functions from Go?
Or, how can I call shared library (*.so) from Go like in python?
答案1
得分: 1
你可以按照这个教程中描述的方法使用C库:
http://cheesesun.blogspot.de/2009/12/basic-cgo.html
还有:
http://siganakis.com/linking-c-libraries-with-go-lang-and-stdc99
或者你可以看看这个库:
https://github.com/awsong/MMSEGO
它是用于中文的,但你可能可以用它来放置你自己的算法。
英文:
you can call use C Libs as described in this tutorial:
http://cheesesun.blogspot.de/2009/12/basic-cgo.html
and:
http://siganakis.com/linking-c-libraries-with-go-lang-and-stdc99
or you may have a look at this library:
https://github.com/awsong/MMSEGO
its for chinese, but you may could use it to put your own algorithm there.
答案2
得分: 0
使用cgo
从Go中调用C代码。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论