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

undefined: readAvailableDictionary #7

Open
so-jelly opened this issue Mar 26, 2020 · 4 comments
Open

undefined: readAvailableDictionary #7

so-jelly opened this issue Mar 26, 2020 · 4 comments

Comments

@so-jelly
Copy link

Using the readme sample code on go playground

../gopath155601560/pkg/mod/github.com/tjarratt/[email protected]/babble.go:22:12: undefined: readAvailableDictionary

@CamiloGarciaLaRotta
Copy link

🙂 I run into the same issue. Anytime babble is run from within a non Windows environment in which it doesn't have access to /usr/share/dict/words it will panic. For example while running it as a non admin user in a container.

I see for Windows @tjarratt copied over the complete list of words, so we could default to it for unix environments if the words file is not found

@CamiloGarciaLaRotta
Copy link

CamiloGarciaLaRotta commented Oct 25, 2020

Ahh it appears the Windows dictionary is not yet used

babble/main.go

Line 19 in aa3777d

// TODO: break the random word functionality into windows && unix helpers

@tjarratt
Copy link
Owner

Hello @CamiloGarciaLaRotta thanks for looking into this a bit. I haven't actually touched this code in years but I think you're right. My goal at the time was to reduce the build size for unix, since including the dictionary for windows was 3.5 megabytes. I've tried too do a quick test right now to see how much of a difference this makes but haven't managed to get it to build :(

I'm not sure which unix systems don't normally have /usr/share/dict/words (I thought that was more widely available) but it would be nice if the dictionary was only compiled in when it can't otherwise be found at runtime.

It's also worth noting @CamiloGarciaLaRotta that the main.go file was included mostly as a proof-of-concept. I think I'm likely going to delete it or move it somewhere else since it doesn't even build for me at the moment.

@jonashdown
Copy link
Contributor

docker images of unix/linux might not have /usr/share/dict/words present. It might be worth documenting that this is a non-go dependency. on Ubuntu it can be solved by running sudo apt-get install -y wbritish

jonashdown added a commit to jonashdown/babble that referenced this issue May 4, 2021
tjarratt#7 -  Update docs to document the dependency on `/usr/share/dict/words`
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

4 participants