
    dj                        d Z ddlZ ej                  dej                        Z ej                  dej                        Z ej                  dej                        ddf ej                  dej                        d	df ej                  d
ej                        ddf ej                  dej                        ddf ej                  dej                        ddfgZdedeeef   fdZ	y)a  DRAFT telecast_type rules for EPG titles -> Crystal's vocabulary.

Ordered rules; first match wins. Vocabulary taken from the real
global_sports.telecast_type distribution:
  LIVE, HIGHLIGHTS, PRE_POST_ANALYSIS, STUDIO, ARCHIVE, NON_EVENT, UNKNOWN

Each rule returns (telecast_type, confidence). Anything that falls through
is UNKNOWN/low and must go to analyst review, never silently to a default.
    Nu   \b(icc|t20|odi|test match|cricket|wc|world cup|cwc|ipl|wt20|fifa|football|uefa|soccer|futbol|fútbol|mundial|copa|liga|olympic|olympics|rugby|tennis|f1|motogp|nba|nfl)\bzs\bcountdown\b|\bgame plan\b|\bmatch point\b|\bfollow the blues\b|\bknow your team\b|\bsports time\b|\bbest of the\bz.\bpre[- ]show\b|\bpost[- ]show\b|\bbuild-?up\bPRE_POST_ANALYSIShighz^\(l\)|\blive\bLIVEzZ\bgreatest matches\b|\bclassics?\b|\blegends\b|\bheroes\b|\brewind\b|\bincredible finals\bARCHIVEzF\bhlts?\.?\b|\bhighlights?\b|\bhls\b|\bhl\b|\bh\s*/\s*l\b|\bmini hls\b
HIGHLIGHTSzP\bpre show\b|\bpost show\b|\bbuild-?up\b|\bpre\b|\bpost\b|\bpreview\b|\breview\btitlereturnc                 "   | xs dj                         }|syt        j                  |      syt        j                  |      ryt        D ]  \  }}}|j                  |      s||fc S  t        j                  d|t
        j                        ryy)z#Return (telecast_type, confidence). )UNKNOWNlow)	NON_EVENTmedium)z-none-r   z%\b[a-z]{2,4}\s+v(?:s)?\s+[a-z]{2,4}\b)r   r   )strip
SPORT_HINTsearchSTUDIO_BRANDRULESreI)r   tpatlabelconfs        2/var/www/html/crystal/crystal2/engine/epg_rules.pyclassifyr   >   s    	"A Q$
 1! UD::a=$;
 
yy91bddC    )
__doc__r   compiler   r   r   r   strtupler    r   r   <module>r#      s    
 RZZ;<>DDB
 rzz:;=44A RZZA244H&" RZZ"BDD)66:
 RZZ 457TT;<EvO RZZY[][_[_`6 RZZ *+-4412EvO3	<C E#s(O r   