A program to recognize and reward our most engaged community members
<?xml version="1.0" encoding="UTF-8" standalone="no"?><process version="7.0.000"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="7.0.000" expanded="true" name="Process"> <process expanded="true"> <operator activated="true" class="generate_data_user_specification" compatibility="7.0.000" expanded="true" height="68" name="Generate Data by User Specification" width="90" x="45" y="34"> <list key="attribute_values"> <parameter key="text" value=""CamelCaseTextOfVariousLengths""/> </list> <list key="set_additional_roles"/> </operator> <operator activated="true" class="nominal_to_text" compatibility="7.0.000" expanded="true" height="82" name="Nominal to Text" width="90" x="179" y="34"/> <operator activated="true" class="replace" compatibility="7.0.000" expanded="true" height="82" name="Replace" width="90" x="313" y="34"> <parameter key="replace_what" value="([A-Z])"/> <parameter key="replace_by" value=" $1"/> </operator> <operator activated="true" class="text:process_document_from_data" compatibility="6.5.000" expanded="true" height="82" name="Process Documents from Data" width="90" x="447" y="34"> <list key="specify_weights"/> <process expanded="true"> <operator activated="true" class="text:tokenize" compatibility="6.5.000" expanded="true" height="68" name="Tokenize" width="90" x="246" y="34"/> <connect from_port="document" to_op="Tokenize" to_port="document"/> <connect from_op="Tokenize" from_port="document" to_port="document 1"/> <portSpacing port="source_document" spacing="0"/> <portSpacing port="sink_document 1" spacing="0"/> <portSpacing port="sink_document 2" spacing="0"/> </process> </operator> <connect from_op="Generate Data by User Specification" from_port="output" to_op="Nominal to Text" to_port="example set input"/> <connect from_op="Nominal to Text" from_port="example set output" to_op="Replace" to_port="example set input"/> <connect from_op="Replace" from_port="example set output" to_op="Process Documents from Data" to_port="example set"/> <connect from_op="Process Documents from Data" from_port="example set" to_port="result 1"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> </process> </operator></process>
Hi Martin, hi everybody
I am facing the same problem as mob. Unfortunately I couldn't solve it using your comment from 02-01-2016.
Problem:
I want to separate the following text: "PleaseSeparateMeByCapitalLetters" into "Please Separate Me By Capital Letters"
I tried to use the Replace Tokens operator
- replace what:[A-Z]
- replace by: $1
However the result is " lease eparate e y apital etters".
Thanks in advance for your help
Andreas
The $1 refers to a "capture expression". You define capture expressions with (). If that's not in the replace what part, then $1 will be empty.
Try this : ([A-Z])(.) ,replace by $1$2 and ensure there is a space before $1. It also adds a space before the first word but you can remove that one again by doing a second regex or trim the string.
so like this :
<parameter key="replace_what" value="([A-Z])(.)"/> <parameter key="replace_by" value=" $1$2"/>
Probably not the most sexy solution but plain simple sometimes does the trick also.
Thank you !!!