Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an example of using this tool on a new set of input? #2

Open
tsouchlarakis opened this issue Jan 28, 2024 · 3 comments
Open

Comments

@tsouchlarakis
Copy link

No description provided.

@datio
Copy link
Owner

datio commented Jan 30, 2024

You should be able to pipe text file input to the grhyph_cli binary if you'd rather not use it as a Go library:

cat your_text.txt | grhyph_cli -separator="-" -quick-synizesis

@tsouchlarakis
Copy link
Author

Thank you. I'm new go Go and am having issues with installation after following instructions from your video:

$ ls
LICENSE        README.md      definitions.go grhyph.go      grhyph_cli     grhyph_test.go
$ cd grhyph_cli/
$ go install
go: cannot find main module, but found .git/config in ~/grhyph
	to create a module there, run:
	cd .. && go mod init

Note I substituted my home path for ~. Is there a missing step of creating a module?

@tsouchlarakis
Copy link
Author

I set export GO111MODULE=auto per this answer, and I'm getting a different message:

$ go install
hyphenation.go:6:2: cannot find package "github.com/datio/grhyph" in any of:
	/opt/homebrew/Cellar/go/1.21.6/libexec/src/github.com/datio/grhyph (from $GOROOT)
	/Users/USER/go/src/github.com/datio/grhyph (from $GOPATH)

I then created the folder /opt/homebrew/Cellar/go/1.21.6/libexec/src/github.com/datio, and copied the grhyph/ package source to it, so the path /opt/homebrew/Cellar/go/1.21.6/libexec/src/github.com/datio/grhyph exists and contains this repo's source code.

I also set the following paths:

export GOROOT=/opt/homebrew/Cellar/go/1.21.6/libexec/bin
export GOPATH=/Users/USER/go

Running go install produces the following:

hyphenation.go:4:2: package flag is not in std (/opt/homebrew/Cellar/go/1.21.6/libexec/bin/src/flag)
hyphenation.go:5:2: package fmt is not in std (/opt/homebrew/Cellar/go/1.21.6/libexec/bin/src/fmt)
hyphenation.go:6:2: cannot find module providing package github.com/datio/grhyph: import lookup disabled by -mod=vendor
	(Go version in go.mod is at least 1.14 and vendor directory exists.)
package std/github.com/datio/grhyph/grhyph_cli: cannot find package

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants