Go to the "Package Dependencies" tab in your Xcode project and click the + button to add a package.
Search for "github.com/landonepps/mecab", select "mecab", and click "Add Package".
Click "Add Package" again.
Go to your targets' "Build Phases" tab and make sure "mecab" shows under "Link Binary with Libraries".
If not, click the + button and add it.
You'll also need to add the dictionary files and a
mecabrc file which tells MeCab where the dictionary files are located.
For an example, see: landonepps/MecabDemo which uses ipadic.
Make sure your dictionary files and
mecabrc file show up under "Copy Bundle Resources".
You can now
import mecab from any file you want to use it from.
MeCab is a C++ library and doesn't work cleanly with Swift. For an example of how to write a Swift wrapper, see landonepps/MecabDemo.
|Last commit: 1 week ago|