<commit_before># parse_fnba.rb
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'optparse'
require 'pp'		


# Parse command line options
def parseOpts(args)

	# Default options
	options = {:verbose => false, :season => '2015', :period => '1',:stats => 'last30'} 

	OptionParser.new do |opts|

		opts.banner = "Usage: fnba.rb [options]"

		opts.separator ""
		opts.separator "Specific options:"

		opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
			options[:verbose] = v
		end

		# Get League 
		opts.on("-l", "--league LEAGUE_ID", "ESPN League ID") do |league|
			options[:league] = league
		end

		# Get Team ID
		opts.on("-t", "--team TEAM_ID,[TEAM2_ID, ...]", Array,"ESPN Team ID(s)") do |team|
			options[:team] = team
		end

		# Scoring Period
		opts.on("-p", "--period SCORING_PERIOD", Integer, "ESPN Scoring Period (Week)") do |period|
			# Convert period from days to weeks
			options[:period] = period * 7 - 6
		end

		# Stats to use
		opts.on("-s","--stats STAT_TYPE","Statistics source to use, default last30") do |stats|
			options[:stats] = stat
		end

		# Use defaults for testing
		opts.on("--test", "Use default test values (league = 23829, team = 12,14)") do |test|
			options[:test] = test
		end

		# Cache content, use cached version if available
		opts.on("-c","--cache", "Use cached content if available") do |format|
			options[:cache] = cache
		end

		# Display Help
		opts.on_tail('-h', '--help', 'Displays Help') do
			puts opts
		exit 0
		end

	end.parse!(args)
	return options

end # parseOpts()

# Parse FNBA team from ESPN URL
def parseTeam(leagueId,teamId,period,stats,verbose)
<commit_msg>Fixed bug in stats option<commit_after># parse_fnba.rb
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'optparse'
require 'pp'		


# Parse command line options
def parseOpts(args)

	# Default options
	options = {:verbose => false, :season => '2015', :period => '1',:stats => 'last30'} 

	OptionParser.new do |opts|

		opts.banner = "Usage: fnba.rb [options]"

		opts.separator ""
		opts.separator "Specific options:"

		opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
			options[:verbose] = v
		end

		# Get League 
		opts.on("-l", "--league LEAGUE_ID", "ESPN League ID") do |league|
			options[:league] = league
		end

		# Get Team ID
		opts.on("-t", "--team TEAM_ID,[TEAM2_ID, ...]", Array,"ESPN Team ID(s)") do |team|
			options[:team] = team
		end

		# Scoring Period
		opts.on("-p", "--period SCORING_PERIOD", Integer, "ESPN Scoring Period (Week)") do |period|
			# Convert period from days to weeks
			options[:period] = period * 7 - 6
		end

		# Stats to use
		opts.on("-s","--stats STAT_TYPE","Statistics source to use, default last30") do |stats|
			options[:stats] = stats
		end

		# Use defaults for testing
		opts.on("--test", "Use default test values (league = 23829, team = 12,14)") do |test|
			options[:test] = test
		end

		# Cache content, use cached version if available
		opts.on("-c","--cache", "Use cached content if available") do |format|
			options[:cache] = cache
		end

		# Display Help
		opts.on_tail('-h', '--help', 'Displays Help') do
			puts opts
		exit 0
		end

	end.parse!(args)
	return options

end # parseOpts()

# Parse FNBA team from ESPN URL
def parseTeam(leagueId,teamId,period,stats,verbose)

{'fraction_non_alphanumeric': 0.15752802181157224, 'fraction_numerical': 0.013329294153286883, 'mean_word_length': 3.605299860529986, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2023254', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1134, 'n_words': 352}