Merge¤
Merge
is a set of standalone functions for merging strings, spaCy Docs, and files.
lexos.cutter.merge.merge(segments, sep=None)
¤
Merge a list of segments into a single string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
segments |
_type_
|
The list of segments to merge. |
required |
sep |
str
|
The separator to use when merging strings. Defaults to None. |
None
|
Source code in lexos\cutter\merge.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
lexos.cutter.merge.merge_files(segment_files, output_file='merged_files.txt', binary=False)
¤
Merge two files into a single string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
segment_files |
List[str]
|
List of files to be merged. |
required |
output_file |
str
|
The name of the output file. |
'merged_files.txt'
|
binary |
bool
|
Whether to read and write files as binary. Defaults to False. |
False
|
Source code in lexos\cutter\merge.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|