guess_month méthode de classe
This commit is contained in:
parent
654314a61b
commit
de4b54baa4
@ -27,7 +27,7 @@ class Extractor(ABC):
|
||||
else:
|
||||
return start_day
|
||||
|
||||
def guess_month(self, text):
|
||||
def guess_month(text):
|
||||
mths = [
|
||||
"jan",
|
||||
"fe",
|
||||
@ -55,14 +55,14 @@ class Extractor(ABC):
|
||||
)
|
||||
if m:
|
||||
day = m.group(1)
|
||||
month = self.guess_month(m.group(2))
|
||||
month = Extractor.guess_month(m.group(2))
|
||||
year = m.group(3)
|
||||
else:
|
||||
# format Numero Mois Annee
|
||||
m = re.search("([0-9]+)[er]*[ ]*([a-zA-ZéÉûÛ:.]+)[ ]*([0-9]+)", text)
|
||||
if m:
|
||||
day = m.group(1)
|
||||
month = self.guess_month(m.group(2))
|
||||
month = Extractor.guess_month(m.group(2))
|
||||
year = m.group(3)
|
||||
else:
|
||||
# format Numero Mois Annee
|
||||
|
Loading…
x
Reference in New Issue
Block a user