medspacy.section_detection.util
This module will contain helper functions and classes for common clinical processing tasks which will be used in medspaCy's sectionizer.
is_end_line(idx, doc, pattern)
Check whether the token at idx occurs at the end of the line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx
|
int
|
The token index to check. |
required |
doc
|
Doc
|
The doc to check in. |
required |
pattern
|
Pattern
|
The newline pattern to check with. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether the token occurs at the end of a line. |
Source code in medspacy/section_detection/util.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
is_start_line(idx, doc, pattern)
Check whether the token at idx occurs at the start of the line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx
|
int
|
The token index to check. |
required |
doc
|
Doc
|
The doc to check in. |
required |
pattern
|
Pattern
|
The newline pattern to check with. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether the token occurs at the start of a line. |
Source code in medspacy/section_detection/util.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |