-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add enhancement, pets, mounts, engravings, consoidate market_data
- Loading branch information
Showing
20 changed files
with
5,615 additions
and
5,313 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,16 @@ | ||
from thefuzz import process | ||
|
||
from modules.market_data.engraving_recipe import engraving_recipe | ||
from modules.market_data.enhancement_material import enhancement_material | ||
from modules.market_data.combat_supplies import combat_supplies | ||
from modules.market_data.cooking import cooking | ||
from modules.market_data.trader import trader | ||
from modules.market_data.adventurers_tome import adventurers_tome | ||
from modules.market_data.sailing import sailing | ||
from modules.market_data.pets import pets | ||
from modules.market_data.mount import mount | ||
from modules.market_data.gem_chest import gem_chest | ||
from modules.market_data.currency_exchange import currency_exchange | ||
from modules.market_data.other import other | ||
|
||
market_map = { | ||
**engraving_recipe, | ||
**enhancement_material, | ||
**combat_supplies, | ||
**cooking, | ||
**trader, | ||
**adventurers_tome, | ||
**sailing, | ||
**pets, | ||
**mount, | ||
**gem_chest, | ||
**currency_exchange, | ||
**other | ||
} | ||
|
||
from modules.market_data.consolidated_map import consolidated_map | ||
|
||
def filter_market_item_name(raw_name: str) -> str | None: | ||
if(raw_name in market_map): | ||
if(raw_name in consolidated_map): | ||
return raw_name | ||
result, confidence = process.extractOne( | ||
raw_name, market_map.keys(), scorer=process.fuzz.token_sort_ratio) | ||
raw_name, consolidated_map.keys(), scorer=process.fuzz.token_sort_ratio) | ||
if confidence < 60: | ||
return None | ||
return result | ||
|
||
|
||
def get_market_item_by_name(name: str) -> dict: | ||
return market_map[name] | ||
return consolidated_map[name] |
Oops, something went wrong.