Documentation ¶
Overview ¶
Package gcgio implements a GCG parser. It might also implement other io methods.
Index ¶
Constants ¶
View Source
const ( PlayerRegex = `#player(?P<p_number>[1-2])\s+(?P<nick>\S+)\s+(?P<real_name>.+)` TitleRegex = `#title\s*(?P<title>.*)` DescriptionRegex = `#description\s*(?P<description>.*)` IDRegex = `#id\s*(?P<id_authority>\S+)\s+(?P<id>\S+)` Rack1Regex = `#rack1 (?P<rack>\S+)` Rack2Regex = `#rack2 (?P<rack>\S+)` MoveRegex = `>(?P<nick>\S+):\s+(?P<rack>\S+)\s+(?P<pos>\w+)\s+(?P<play>[\p{L}\\.]+)\s+\+(?P<score>\d+)\s+(?P<cumul>\d+)` NoteRegex = `#note (?P<note>.+)` LexiconRegex = `#lexicon (?P<lexicon>.+)` CharacterEncodingRegex = `#character-encoding (?P<encoding>[[:graph:]]+)` PhonyTilesReturnedRegex = `>(?P<nick>\S+):\s+(?P<rack>\S+)\s+--\s+-(?P<lost_score>\d+)\s+(?P<cumul>\d+)` PassRegex = `>(?P<nick>\S+):\s+(?P<rack>\S+)\s+-\s+\+0\s+(?P<cumul>\d+)` ChallengeBonusRegex = `>(?P<nick>\S+):\s+(?P<rack>\S*)\s+\(challenge\)\s+\+(?P<bonus>\d+)\s+(?P<cumul>\d+)` ExchangeRegex = `>(?P<nick>\S+):\s+(?P<rack>\S+)\s+-(?P<exchanged>\S+)\s+\+0\s+(?P<cumul>\d+)` EndRackPointsRegex = `>(?P<nick>\S+):\s+\((?P<rack>\S+)\)\s+\+(?P<score>\d+)\s+(?P<cumul>-?\d+)` TimePenaltyRegex = `>(?P<nick>\S+):\s+(?P<rack>\S*)\s+\(time\)\s+\-(?P<penalty>\d+)\s+(?P<cumul>-?\d+)` PtsLostForLastRackRegex = `>(?P<nick>\S+):\s+(?P<rack>\S+)\s+\((?P<rack>\S+)\)\s+\-(?P<penalty>\d+)\s+(?P<cumul>-?\d+)` )
Variables ¶
View Source
var GCGRegexes []gcgdatum
Functions ¶
func GameHistoryToGCG ¶ added in v0.4.2
func GameHistoryToGCG(h *pb.GameHistory, addlHeaderInfo bool) (string, error)
GameHistoryToGCG returns a string GCG representation of the GameHistory.
func ParseGCGFromReader ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.