Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -114,7 +114,7 @@ def conc(text_Party,strng):
|
|
114 |
s=result.getvalue().splitlines()
|
115 |
return result.getvalue()
|
116 |
|
117 |
-
def get_all_phases_containing_tar_wrd(target_word, tar_passage, left_margin = 10, right_margin = 10,numLins=
|
118 |
"""
|
119 |
Function to get all the phases that contain the target word in a text/passage tar_passage.
|
120 |
Workaround to save the output given by nltk Concordance function
|
@@ -139,7 +139,8 @@ def get_all_phases_containing_tar_wrd(target_word, tar_passage, left_margin = 10
|
|
139 |
## join the sentences for each of the target phrase and return it
|
140 |
result = [''.join([x.replace("Y","")+' ' for x in con_sub]) for con_sub in concordance_txt][:-1]
|
141 |
result=result[:numLins+1]
|
142 |
-
|
|
|
143 |
return res
|
144 |
|
145 |
|
|
|
114 |
s=result.getvalue().splitlines()
|
115 |
return result.getvalue()
|
116 |
|
117 |
+
def get_all_phases_containing_tar_wrd(target_word, tar_passage, left_margin = 10, right_margin = 10,numLins=4):
|
118 |
"""
|
119 |
Function to get all the phases that contain the target word in a text/passage tar_passage.
|
120 |
Workaround to save the output given by nltk Concordance function
|
|
|
139 |
## join the sentences for each of the target phrase and return it
|
140 |
result = [''.join([x.replace("Y","")+' ' for x in con_sub]) for con_sub in concordance_txt][:-1]
|
141 |
result=result[:numLins+1]
|
142 |
+
|
143 |
+
res='\n\n'.join(result)
|
144 |
return res
|
145 |
|
146 |
|