Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,16 +48,37 @@ def proc_nouns(sen_list):
|
|
| 48 |
print("done nouns")
|
| 49 |
return noun_list
|
| 50 |
|
| 51 |
-
def sort_doc(text,
|
| 52 |
text=str(text)
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
json_out={}
|
| 63 |
noun_list={}
|
|
@@ -83,19 +104,7 @@ def sort_doc(text,steps=1):
|
|
| 83 |
cnt=0
|
| 84 |
go=True
|
| 85 |
|
| 86 |
-
|
| 87 |
-
nx=key_cnt
|
| 88 |
-
while True:
|
| 89 |
-
if nx >= 1:
|
| 90 |
-
n_cnt+=1
|
| 91 |
-
nx = nx/char_len
|
| 92 |
-
else:
|
| 93 |
-
print("#######")
|
| 94 |
-
print(n_cnt)
|
| 95 |
-
print(nx)
|
| 96 |
-
print("#######")
|
| 97 |
-
steps=n_cnt
|
| 98 |
-
break
|
| 99 |
|
| 100 |
for ii in range(steps):
|
| 101 |
print(ii)
|
|
|
|
| 48 |
print("done nouns")
|
| 49 |
return noun_list
|
| 50 |
|
| 51 |
+
def sort_doc(text,steps_in=0,control=None):
|
| 52 |
text=str(text)
|
| 53 |
+
|
| 54 |
+
if not steps_in:
|
| 55 |
+
|
| 56 |
+
control_char=list(control_json['control'])
|
| 57 |
+
char_len=len(control_char)
|
| 58 |
+
n_cnt=0
|
| 59 |
+
nx=key_cnt
|
| 60 |
+
while True:
|
| 61 |
+
if nx >= 1:
|
| 62 |
+
n_cnt+=1
|
| 63 |
+
nx = nx/char_len
|
| 64 |
+
else:
|
| 65 |
+
print("#######")
|
| 66 |
+
print(n_cnt)
|
| 67 |
+
print(nx)
|
| 68 |
+
print("#######")
|
| 69 |
+
steps=n_cnt
|
| 70 |
+
break
|
| 71 |
+
if steps_in:
|
| 72 |
+
steps=steps_in
|
| 73 |
+
|
| 74 |
+
control_len=control_json['leng']-steps
|
| 75 |
+
|
| 76 |
+
control_char_val=list(control_json['control'][:control_len])
|
| 77 |
+
control_val=list(control_json['control'][control_len:])
|
| 78 |
+
val_len=len(control_val)
|
| 79 |
+
|
| 80 |
+
#print(control_char)
|
| 81 |
+
#print(control_val)
|
| 82 |
|
| 83 |
json_out={}
|
| 84 |
noun_list={}
|
|
|
|
| 104 |
cnt=0
|
| 105 |
go=True
|
| 106 |
|
| 107 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
for ii in range(steps):
|
| 110 |
print(ii)
|