Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion style_predictor/pgn_parser/file_processing/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def lex(self) -> None | list[Token]:
case "\n":
_ = self.read()
self._cr_pos()
if self.peek() == "1":
if self.peek() and self.peek().isdigit():
self.lex_movetext()
# break
case None:
Expand Down
6 changes: 3 additions & 3 deletions style_predictor/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def get_games_analysis(
Returns:
Dict with statistical analysis of the games provided.
"""
names = {n.strip() for n in username.split("||")}
names = {n.strip().lower() for n in username.split("||")}
total = len(pgn_games)
wins = losses = draws = 0
opp_mapping: list[tuple[int, int | None]] = []
Expand All @@ -254,8 +254,8 @@ def get_games_analysis(
if eco_code := tags.get("ECO", None):
opening_mapper.append((eco_code, " ".join([str(move) for move in g.moves])))

is_white = white in names
is_black = black in names
is_white = white.lower() in names
is_black = black.lower() in names

# win/loss/draw
if result == constants.DRAW:
Expand Down