You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case someone else finds it useful, here's a script for romanizing strings through python. This script will download the release and unzip it, so you should be able to just run it to test:
importosimportzipfileimportrequestsimportsubprocess# Downloading the zip fileurl='https://github.com/isi-nlp/uroman/archive/refs/tags/v1.2.8.zip'zip_filename='uroman.zip'withopen(zip_filename, 'wb') aszip_file:
response=requests.get(url)
zip_file.write(response.content)
# Unzipping the downloaded filewithzipfile.ZipFile(zip_filename, 'r') aszip_ref:
zip_ref.extractall()
# Function to call the unzipped codedefuroman(input_string, language=None, chart=False):
script_path='uroman-1.2.8/bin/uroman.pl'# Adjust if necessarycommand= ["perl", script_path]
# Add language flag if specifiediflanguage:
command.extend(["-l", language])
# Add chart flag if specifiedifchart:
command.append("--chart")
process=subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr=process.communicate(input=input_string.encode())
ifprocess.returncode!=0:
# There was an errorprint(f"Error code {process.returncode}: {stderr.decode()}")
returnNone# Return the output as a stringreturnstdout.decode()
# Example usageprint(uroman("Ἰησοῦς Χριστός κύριος"))
The text was updated successfully, but these errors were encountered:
Thanks. Responding to growing interest in a Python version, I reimplemented uroman in Python and made it available on PyPI so that people can install it more easily ("pip install uroman").
In case someone else finds it useful, here's a script for romanizing strings through python. This script will download the release and unzip it, so you should be able to just run it to test:
The text was updated successfully, but these errors were encountered: