Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,9 +71,9 @@ def search_pattern(fulltext, pattern, method):
|
|
| 71 |
import time
|
| 72 |
start = time.time()
|
| 73 |
occurrence = 0
|
| 74 |
-
for i in range(0,len(
|
| 75 |
if string[i:i+len(pattern)] == pattern:
|
| 76 |
-
print("Found ",
|
| 77 |
occurrence += 1
|
| 78 |
|
| 79 |
end = time.time()
|
|
|
|
| 71 |
import time
|
| 72 |
start = time.time()
|
| 73 |
occurrence = 0
|
| 74 |
+
for i in range(0,len(fulltext)-len(pattern)):
|
| 75 |
if string[i:i+len(pattern)] == pattern:
|
| 76 |
+
print("Found ", fulltext[i:i+len(pattern)], ' locating at position ', i+1)
|
| 77 |
occurrence += 1
|
| 78 |
|
| 79 |
end = time.time()
|