Closed Sirius79 closed 1 year ago
Thanks for reporting this. What version of spacy do you have installed?
Never mind, the error comes from the ztools code (nothing to do with spacy). Here https://github.com/microsoft/jericho/blob/master/frotz/src/ztools/showdict.c#L71-L75
I don't have access to a Mac right now but I've tested your code example on Python 3.9.15, Linux and it works fine. I assume it's something related to MacOS (or your C compiler).
Understood. I also tried following the solution in #40 but that didn't help.
For now, I have commented out https://github.com/microsoft/jericho/blob/8637c21df1c75672842d521bb21be643bc8b18a3/frotz/src/ztools/showdict.c#L73-L74
Thanks for your help!
@Sirius79 can you try printing the value for dict_size
and word_count
for zork1.z5 ?
@MarcCote I'm getting the following values:
word_count
: 697
dict_size
: 83397896
The dict_size
is changing for each run
Ok, that's seems problematic. What's the output of
from jericho import *
env = FrotzEnv("../roms/jericho-game-suite/zork1.z5")
print(env.frotz_lib.get_dictionary_word_count("../roms/jericho-game-suite/zork1.z5"))
?
Getting the following error for the last line:
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
Opps, try this.
from jericho import *
env = FrotzEnv("../roms/jericho-game-suite/zork1.z5")
print(env.frotz_lib.get_dictionary_word_count(env.story_file))
This prints 697
Ok that's interesting. It seems get_dictionary is missing an argument! Can you try changing this line https://github.com/microsoft/jericho/blob/master/jericho/jericho.py#L333 from
frotz_lib.get_dictionary.argtypes = [POINTER(DictionaryWord)]
to
frotz_lib.get_dictionary.argtypes = [POINTER(DictionaryWord), c_int]
Yep it's working now! Thanks a lot for your help!
Awesome! I'll make a commit and make a release later today.
The main branch should work now.
Thanks for the quick fix!
I am having issues running some of the methods like
env.get_dictionary()
andenv.get_valid_actions()
. Both of them are giving the error: Error: Word count doesn't match dictionary size!This is the code snippet I'm using:
Setup
Can you please help me figure out if I'm missing anything here?