Segment text in smaller units¶
Goal¶
Segment text in smaller units (e.g. lines, words, letters, etc.).
Prerequisites¶
Some text has been imported in Orange Textable (see Cookbook: Text input) and possibly further processed (see Cookbook: Segmentation manipulation).
Ingredients¶
Widget
Icon
Quantity
1
Procedure¶

Figure 1: Segment text in words with an instance of Segment.¶
Create an instance of Segment.
Drag and drop from the output (righthand side) of the widget that emits the segmentation to be segmented, here Text Field (Hamlet), to the input of Segment (lefthand side).
Double-click on the icon of Segment to open its interface.
In the Segment type section, you can choose to segment the text into letters, words or lines using the drop-down menu.
Click the Send button or tick the Send automatically checkbox.
A segmentation containing a segment for each specified unit (e.g. line) is then available at the output of Segment; to display or export it, see Cookbook: Text output.
Comment¶
You can also segment text using any kind of pattern that can be described by Python regular expressions (cf. Regular expressions) with the Use a regular expression option.