Skip to content

Commit

Permalink
variable name modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
aniket22n committed Apr 26, 2022
1 parent b3502d9 commit 206f5ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Binary file modified __pycache__/transliterate.cpython-39.pyc
Binary file not shown.
13 changes: 6 additions & 7 deletions program.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

from werkzeug.utils import secure_filename
import os
import PyPDF2
from PyPDF2 import PdfFileReader

import PIL
from PIL import Image, ImageDraw
import spacy
# import spacy

import pytesseract as pt
from pdf2image import convert_from_path, convert_from_bytes

from pdf2image import convert_from_path, convert_from_bytes
from pdf2image.exceptions import (
PDFInfoNotInstalledError,
PDFPageCountError,
Expand Down Expand Up @@ -103,13 +102,13 @@ def search():
lang = {'hindi':"hi-t-i0-und"}
if request.method == "POST":
user_serach = request.form["user_search"]
output = transliterate.driver(user_serach.strip(), lang['hindi'])
return redirect(url_for("temp", search = output))
output = transliterate.transliteration(user_serach.strip(), lang['hindi'])
return redirect(url_for("transliteration_search", search = output))
else:
return redirect('/')

@program.route("/<search>")
def temp(search):
def transliteration_search(search):
search_list = []
for x in search.split(" "):
if x != "":
Expand Down
3 changes: 1 addition & 2 deletions transliterate.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import http.client
import json

def request(input, lang):
conn = http.client.HTTPSConnection('inputtools.google.com')
conn.request('GET', '/request?text=' + input + '&itc=' + lang + '&num=1&cp=0&cs=1&ie=utf-8&oe=utf-8&app=test')
res = conn.getresponse()
return res

def driver(input, lang):
def transliteration(input, lang):
output = ''
if ' ' in input:
input = input.split(' ')
Expand Down

0 comments on commit 206f5ca

Please sign in to comment.