From 134dcbaba30e732445c63f2ac7bb4d2f0283ed2d Mon Sep 17 00:00:00 2001 From: beville Date: Tue, 4 Dec 2012 05:28:06 +0000 Subject: [PATCH] handle the case of "of XX" without parentheses git-svn-id: http://comictagger.googlecode.com/svn/trunk@202 6c5673fe-1810-88d6-992b-cd32ca31540c --- filenameparser.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/filenameparser.py b/filenameparser.py index 017d220..ef9eae5 100644 --- a/filenameparser.py +++ b/filenameparser.py @@ -89,6 +89,15 @@ class FileNameParser: tmpstr = self.fixSpaces(filename) word_list = tmpstr.split(' ') + #before we search, remove any kind of likely "of X" phrase + for i in range(0, len(word_list)-2): + if ( word_list[i].isdigit() and + word_list[i+1] == "of" and + word_list[i+2].isdigit() ): + word_list[i+1] ="XXX" + word_list[i+2] ="XXX" + + # assume the last number in the filename that is under 4 digits is the issue number for word in reversed(word_list): if (