generated from runelite/example-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
[Surprise Exam] Fix incorrect solutions and early returning #39
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Removed the code that calculates how many matches are in a relation and returns early if it's 4 - This fixed the issue(s) with broader relationships early returning despite another specific item was the answer - Added test case which was broken prior to this commit changes thanks to @rmobis
- Modified similarity thresholds - Refactored scoring constants/multipliers into statically defined variables instead - Add support for negation words for puzzles hints containing negations - Added NEGATION_WORDS for negation keywords and NEGATION_OPPOSITE_MAP to map the reverse of various relationships - Fixes various matching puzzles that have hints like "who hate ranging or magic" where hate signals the negation - Added #detectNegatedTokens to parse the hint for negation keywords and apply negation handling in analyzeRiddleAndFindItems(): - Modify #analyzeRiddleAndFindItems to handle negations - Penalize the relationship (hint words vs relationship) score for the relationship(s) being negated - Multiply negation's opposite relationship scores - Added support for inverse context keyword matching within #expandWithContextAndSynonyms - Correctly use JaroWinklerDistance#apply - Invert similarity distance logic - Use similarity (instead of inverted) and its threshhold within #getRelationshipSimilarity - Added extra test cases for matching puzzles with negation hints like "who hate ranging or magic" and more
Owner
Author
fix(surpriseexam): Improve relationship scoring and handle negation keywords
Fixes the two incorrect matching puzzles found in #33 (comment) |
Owner
Author
test(surpriseexam): Add more tests for missing item puzzlesAdded more test cases as found in #33 (comment) |
- Fixed next missing item solver from returning early and giving incorrect solutions - Caused by multiple relations having full matches - Fixed next missing item puzzle that were weapons, and the answer set two different weapons melee/range - Improved the OSRSItemRelationshipSystem and fixed wrong matching puzzle solutions - Reworked similarity distance and inverted the existing logic - Modified existing thresholds and multipliers - Added support for negations and matching puzzles with negated hints such as "hate ranging" - Fixed wrong matching puzzle solutions that contained hints like "who hate ranging or magic"
Owner
Author
chore: Update plugin to v2.6.1
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
implementing
Actively working on this issue/PR
surprise-exam
Surprise Exam module
testing
Testing and verifying the changes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix(surpriseexam): Fixed next missing item solver from early return
Example: Initial items were ranged and answer set [longsword, bow] -> they are both in COMBAT_ECOSYSTEM so it would early return matching the first item (longsword) instead of checking the other items too which would be the shortbow belonging to the answer relationship - RANGED_WEAPONS (See #33 (comment) for the particular problem)