Skip to content

Commit

Permalink
fuzzier item name classification
Browse files Browse the repository at this point in the history
  • Loading branch information
gogodr committed May 5, 2022
1 parent a5cc31b commit 1cd3a0c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## LostArk Market Watcher 0.4.11
## LostArk Market Watcher 0.4.12
This app listens to the screenshot folder for new files.
Starting on the version 0.3.0 this app needs to be launched through the [Lost Ark Market Launcher](https://github.com/gogodr/LostArk-Market-Launcher)
Each new file is scanned and if the market window is detected in the picture then the image is segmented.
Expand All @@ -21,6 +21,9 @@ In order to contribute to the LostArk Marketplace database, the contributor must
Audio files from [MixKit](https://mixkit.co/)

### Changelog
### 0.4.12
- Make name filter classificator fuzzier

### 0.4.11
- Link error logs from db instance

Expand Down
2 changes: 1 addition & 1 deletion index.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ui.config.config import LostArkMarketWatcherConfig
from ui.log.log import LostArkMarketWatcherLog

version = '0.4.11'
version = '0.4.12'
debug = True


Expand Down
4 changes: 2 additions & 2 deletions modules/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def add_entry(self, market_line: MarketLine, play_audio=True):

to_update['updatedAt'] = datetime.utcnow()
to_update['author'] = self.uid
to_update['watcher-version'] = self.version
to_update['watcher_version'] = self.version

item_doc_ref.update(to_update)

Expand All @@ -120,7 +120,7 @@ def add_entry(self, market_line: MarketLine, play_audio=True):
'recentPrice': market_line.recent_price,
'createdAt': datetime.utcnow(),
'author': self.uid,
'watcher-version': self.version
'watcher_version': self.version
})

self.log.emit(f"Updated: {market_line.name} | {market_line.avg_price} | {market_line.recent_price} | {market_line.lowest_price} | {market_line.cheapest_remaining}")
Expand Down
16 changes: 12 additions & 4 deletions modules/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import numpy as np
import pytesseract
import os
import re

from concurrent.futures import ThreadPoolExecutor, wait
from modules.common.market_line import MarketLine
Expand Down Expand Up @@ -232,10 +233,17 @@ def process_line(screenshot, tab, anchor, line_index, debug=False, log_cb=lambda
if name is None:
return None

if name.find('[Sold in bundles') > 0:
name = name[0:name.find('[Sold in bundles')].strip()
if name.find('[Untradable upon') > 0:
name = name[0:name.find('[Untradable upon')].strip()
if debug:
log_cb(f"Raw Name: {name}")


name = re.sub(f"\n*[\(\[]Sold in bundles.*","",name)

name = re.sub(f"\n*[\(\[]Untradable upon.*","",name)

if debug:
log_cb(f"Filtered Name: {name}")
log_cb(f"=================================")

# Filter name with whitelist
name = filter_market_item_name(name)
Expand Down

0 comments on commit 1cd3a0c

Please sign in to comment.