Text file name normalizer now removes punctuation from titles
This commit is contained in:
parent
8084233c64
commit
05ba1d01f6
|
@ -1,4 +1,4 @@
|
||||||
import requests, re
|
import requests, re, string
|
||||||
from jsonpath import jsonpath
|
from jsonpath import jsonpath
|
||||||
from urllib.parse import quote as raw_quote
|
from urllib.parse import quote as raw_quote
|
||||||
import argparse
|
import argparse
|
||||||
|
@ -29,7 +29,7 @@ def processTranscript(r,dir_style=1):
|
||||||
return "\n".join(text)
|
return "\n".join(text)
|
||||||
|
|
||||||
def normalize(t):
|
def normalize(t):
|
||||||
return t.lower().replace(" ","_")
|
return "".join(filter(lambda x: not x in string.punctuation,t.lower())).replace(" ","_")
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
parser = argparse.ArgumentParser(description="Grabs transcripts.")
|
parser = argparse.ArgumentParser(description="Grabs transcripts.")
|
||||||
|
|
Loading…
Reference in New Issue