Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
import re
|
4 |
+
|
5 |
+
def extract_sentence_parts(text):
|
6 |
+
# Regular expression to match sentence parts
|
7 |
+
pattern = r'\b[A-Z][\w\s]*[\d\.]'
|
8 |
+
matches = re.findall(pattern, text)
|
9 |
+
|
10 |
+
# Filter matches longer than 10 characters
|
11 |
+
long_matches = [match for match in matches if len(match) > 10]
|
12 |
+
|
13 |
+
return long_matches
|
14 |
+
|
15 |
+
# Test string
|
16 |
+
test_string = "LOINC,Detailed_description,exercise,questions of ,216 Exercise activity & pain severity panel 10591 Exercise stress test study 18280 D-Lactate^1st specimen post exercise 18281 D-Lactate^2nd specimen post exercise 18282 D-Lactate^3rd specimen post exercise 18283 D-Lactate^4th specimen post exercise 18284 D-Lactate^5th specimen post exercise 18285 D-Lactate^6th specimen post exercise 18286 D-lactate^pre exercise 24690 Time^post exercise 34256 Breaths^post exercise 34257 Heart rate^post exercise 34262 Gas delivery source^post exercise 34264 Gas flow.oxygen^post exercise 34266 Oxygen saturation^post exercise 34417 Heart beat^pre exercise 34418 Heart rate^post exercise 34420 Oxygen^post exercise 34421 Oxygen saturation^pre exercise 34422 Oxyhemoglobin/Hemoglobin.total^post exercise 37279..."
|
17 |
+
|
18 |
+
result = extract_sentence_parts(test_string)
|
19 |
+
print(result)
|