xmltv/lib IMDB.pm,1.65,1.66

Jerry Veldhuis <[email protected]>
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/lib
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30381/lib

Modified Files:
	IMDB.pm 
Log Message:
minor perldoc cleanup
added --validate-title <title> --validate-year <year> for quick db checks
cleaned up alternative titles code


Index: IMDB.pm
===================================================================
RCS file: /cvsroot/xmltv/xmltv/lib/IMDB.pm,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** IMDB.pm	21 Feb 2015 04:59:17 -0000	1.65
--- IMDB.pm	8 Mar 2015 19:46:34 -0000	1.66
***************
*** 591,598 ****
  
      # try the "Columbo: Columbo cries Wolf" -> "Columbo cries Wolf" conversion
!     my @orig_titles=@titles;
!     foreach (@orig_titles) {
!         if ( m/^[^:]+:.+$/io ) {
! 	    my $t=$_;
              while ( $t=~s/^[^:]+:\s*(.+)\s*$/$1/io ) {
                  push(@titles, $t);
--- 591,598 ----
  
      # try the "Columbo: Columbo cries Wolf" -> "Columbo cries Wolf" conversion
!     my $max=scalar(@titles);
!     for (my $i=0; $i<$max ; $i++) {
! 	my $t=$titles[$i];
!         if ( $t=~m/^[^:]+:.+$/io ) {
              while ( $t=~s/^[^:]+:\s*(.+)\s*$/$1/io ) {
                  push(@titles, $t);
***************
*** 602,619 ****
  
      # Place the articles last
!     @orig_titles=@titles;
!     foreach (@orig_titles) {
!         if ( m/^(The|A|Une|Les|Los|Las|L\'|Le|La|El|Das|De|Het|Een)\s+(.*)$/io ) {
! 	    my $t=$_;
              $t=~s/^(The|A|Une|Les|Los|Las|L\'|Le|La|El|Das|De|Het|Een)\s+(.*)$/$2, $1/iog;
              push(@titles, $t);
          }
      }
  
      # convert all the special language characters
!     @orig_titles=@titles;
!     foreach (@orig_titles) {
! 	if ( m/[ÀÁÂÃÄÅàáâãäåÈÉÊËèéêëÌÍÎÏìíîïÒÓÔÕÖØòóôõöøÙÚÛÜùúûüÆæÇçÑñßÝýÿ]/io ) {
! 	    my $t=$_;
  	    $t=~s/[ÀÁÂÃÄÅàáâãäå]/a/gio;
  	    $t=~s/[ÈÉÊËèéêë]/e/gio;
--- 602,623 ----
  
      # Place the articles last
!     $max=scalar(@titles);
!     for (my $i=0; $i<$max ; $i++) {
! 	my $t=$titles[$i];
!         if ( $t=~m/^(The|A|Une|Les|Los|Las|L\'|Le|La|El|Das|De|Het|Een)\s+(.*)$/io ) {
              $t=~s/^(The|A|Une|Les|Los|Las|L\'|Le|La|El|Das|De|Het|Een)\s+(.*)$/$2, $1/iog;
              push(@titles, $t);
          }
+         if ( $t=~m/^(.+),\s*(The|A|Une|Les|Los|Las|L\'|Le|La|El|Das|De|Het|Een)$/io ) {
+             $t=~s/^(.+),\s*(The|A|Une|Les|Los|Las|L\'|Le|La|El|Das|De|Het|Een)$/$2 $1/iog;
+             push(@titles, $t);
+         }
      }
  
      # convert all the special language characters
!     $max=scalar(@titles);
!     for (my $i=0; $i<$max ; $i++) {
! 	my $t=$titles[$i];
! 	if ( $t=~m/[ÀÁÂÃÄÅàáâãäåÈÉÊËèéêëÌÍÎÏìíîïÒÓÔÕÖØòóôõöøÙÚÛÜùúûüÆæÇçÑñßÝýÿ]/io ) {
  	    $t=~s/[ÀÁÂÃÄÅàáâãäå]/a/gio;
  	    $t=~s/[ÈÉÊËèéêë]/e/gio;
***************
*** 626,637 ****
  	    $t=~s/[ß]/ss/gio;
  	    $t=~s/[Ýýÿ]/y/gio;
! 	    $t=~s/[¿]//gio;
  	    push(@titles, $t);
  	}
      }
  
!     # strip some punctuation
!     for (my $i=0; $i<scalar(@titles) ; $i++) {
! 	$titles[$i]=~s/\.//gio;
      }
      return(\@titles);
--- 630,646 ----
  	    $t=~s/[ß]/ss/gio;
  	    $t=~s/[Ýýÿ]/y/gio;
! 	    $t=~s/[¿]//gio;
  	    push(@titles, $t);
  	}
      }
  
!     # optional later possible titles include removing the '.' from titles
!     # ie "Project V.I.P.E.R." matching imdb "Project VIPER"
!     $max=scalar(@titles);
!     for (my $i=0; $i<$max ; $i++) {
! 	my $t=$titles[$i];
! 	if ( $t=~s/\.//go ) {
! 	    push(@titles,$t);
! 	}
      }
      return(\@titles);
***************
*** 643,647 ****
  
      my @titles=@{alternativeTitles($title)};
! 	
      if ( $exact == 1 ) {
  	# try an exact match first :)
--- 652,656 ----
  
      my @titles=@{alternativeTitles($title)};
! 
      if ( $exact == 1 ) {
  	# try an exact match first :)
***************
*** 1995,2003 ****
  		return(-1);
  	    }
- 	    if ( !($_=<$fh>) || !m/^.*\s+\S+\s*$/o ) {
- 		$self->error("missing title/keyword pairs after ======= at line $lineCount");
- 		closeMaybeGunzip($file, $fh);
- 		return(-1);
- 	    }
  	    last;
  	}
--- 2004,2007 ----

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/

_______________________________________________
xmltv-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmltv-commit
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.