-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathhdtp.py
75 lines (40 loc) · 1.16 KB
/
hdtp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/python3
import stack
from stack import *
import parser
from parser import *
def HindiParser(string):
## convert input to lower case
string = string.lower()
## split the input into words(list)
words = string.split(" ")
## get the dictinary of stacks
Final = stack_algo(words)
# empty function makes empty
## Get parsed dictionary from Final Dictionary
Answer = get_parsed(Final)
return Answer
def GetEmails(string):
string = string.lower()
words = string.split(" ")
emails = get_emails_parsed(words)
return emails
def GetIndianPhoneNumbers(string):
words = string.split(" ")
phonenumbers = get_numbers_parsed(words)
return phonenumbers
def DiseaseFinder(ln, string):
## use language detection
## or convert without depending on input language
if (ln == "en") or (ln == "english"):
disease_name = get_disease(string)
return disease_name
if (ln == "hi") or (ln == "hindi"):
##first translate string
disease_name = get_disease(string)
return disease_name
def GetSentences(str):
return get_sentences(str)
def GetTokens(str):
return get_tokens(str)
## if input text is nul for every function, ask for the text