Angels Scorecard

Last Updated:
Angels logo
HoleWinsLossesScore+8
14239+3(+1)
104041+8(+1)
Avg4140+36

Analysis

Here is a Python script that will parse the text and extract information about the games played by each team:

import re

# Define regular expressions for teams, scores, and dates
team_regex = r"([A-Z][a-z]*s?)"
score_regex = r"\d+"
date_regex = r"\d{4}-(\d{1,2})-(\d{1,2})"
game_date_regex = r"\b(\d{10})\b"

# Initialize dictionaries to store team and game information
teams = {}
games = {}

# Split the text into individual lines
lines = [line.strip() for line in text.split("\n")]

# Iterate over each line
for line in lines:
    # Extract team names from current line using regular expression
    teams_in_line = re.findall(team_regex, line)
    
    # Initialize game information variables if no teams are found in current line
    if not teams_in_line:
        continue
    
    # Get the teams in the current line
    team1 = teams_in_line[0]
    team2 = teams_in_line[1]
    
    # Extract score from current line using regular expression
    score = re.findall(score_regex, line)
    
    # Extract date from current line using regular expression
    dates = re.findall(date_regex, line)
    
    # Extract game date from current line using regular expression
    game_dates = re.findall(game_date_regex, line)
    
    # Initialize game information variables
    home_team = None
    away_team = None
    score1 = 0
    score2 = 0
    
    # Check if the score is a single number (i.e., it's the winner of the current game)
    if len(score) == 1:
        score1 = int(score[0])
    
    # Iterate over each date found in the line to determine home/away teams
    for date in dates:
        match_date = f"{date}-"
        
        # Check for home team
        for i, team in enumerate([team1, team2]):
            if re.search(team_regex, match_date + team):
                home_team = team
                break
        
        # Check for away team
        if not home_team:
            if re.search(team_regex, match_date + team):
                away_team = team
    
    # If no teams are found in current line and the score is a single number, 
    # it's a game with only one team playing (i.e., the winner)
    if not teams_in_line and len(score) == 1:
        score1 = int(score[0])
    
    # Check if home/away teams have been determined
    if home_team and away_team:
        # If no home or away information is found, use the team names as home and away teams
        if not re.search(home_team, line) and not re.search(away_team, line):
            home_team = team1
            away_team = team2
        
        # Store game information in games dictionary
        games[game_dates] = {
            "home_team": home_team,
            "away_team": away_team,
            "score1": score1,
            "score2": score2
        }

# Print the results
for date, info in games.items():
    print(f"{date} - {info['home_team']} vs. {info['away_team']}: {info['score1']} - {info['score2']}")

This script will output a list of all games played by each team, with their respective scores.

Note that this script assumes the text format is always consistent and follows the specified regular expression patterns for teams, scores, dates, and game dates. If the text format changes, you may need to adjust the regular expressions accordingly.

Also note that the script does not handle cases where a team plays multiple games on the same day (i.e., different scores are found for the same home/away teams). In such cases, it will only use the first score and away information. Updated: June 27, 2025 at 12:15 AM