dhowe / rita

Website, documentation and examples for RiTa
https://rednoise.org/rita
72 stars 9 forks source link

RiTa.randomWord({targetPos:}) returns wrong POS #120

Closed LifeIsADeflatingVest closed 3 years ago

LifeIsADeflatingVest commented 3 years ago

I'm using RiTa 2.4.86 with JavaScript.

I have repeatedly tested RiTa.randomWord({targetPos:"[POS Tag]"}) and consistently get wrong parts of speech. Examples:

RiTa.randomWord({targetPos:"nns"}) output x4: usable, breathless, maltreatment, suck

RiTa.randomWord({targetPos:"jj"}) output x4: receptacle, blame, parch, acrobat

RiTa.randomWord({targetPos:"vb"}) output x4: philosophic, branch, microbial, dryer

I also tried with capitals (e.g. targetPos:"VB" ) with similar results. Any ideas?

Edit: For troubleshooting, I tried RiTa.randomWord({targetPos:"vddafb"}), and it was also ignored (I expected an "unexpected pos" error). It seems that targetPos is ignored for some reason.

dhowe commented 3 years ago

Thanks for the report. This appears to be a problem with the example in the documentation. The correct option (as documented in the parameters section, is "pos".

RiTa.randomWord({ pos: "nns" })
RiTa.randomWord({ pos: "jj" })
RiTa.randomWord({ pos: "vb" })

I will update the page. You can close this ticket if this resolves the problem.

LifeIsADeflatingVest commented 3 years ago

Yep, works as expected now.

Thanks for this — and massive thanks for this amazing library, I use it very often and promote it on my blog posts.

dhowe commented 3 years ago

Thanks for this — and massive thanks for this amazing library, I use it very often and promote it on my blog posts. Really nice to hear, thanks so much... (happy to add any projects you've done with it to the gallery)

LifeIsADeflatingVest commented 3 years ago

Really nice to hear, thanks so much... (happy to add any projects you've done with it to the gallery)

Thanks, there's one there already! :blush: https://rednoise.org/rita/gallery/AnapestGenerator