The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Problem by transforming documents [SOLVED]

josejose Member Posts: 16 Contributor II
edited April 2020 in Help
Hi
I'm working with text in Spanish.
I have a text:

"La canción que escuché es hermosa. La estación del tren está llena."

The problem is that it uses Spanish accents (á). I want to get as result:

"la cancion que escuche es hermosa. La estacion del tren esta llena."

My question is that operators use to transform a paragraph of text or an entire document to remove accents (á).

thanks

Answers

  • Nils_WoehlerNils_Woehler Member Posts: 463 Maven
    Hi,

    you can use the "Replace Tokens" operator. Take a look here:


    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.2.007">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.2.007" expanded="true" name="Process">
        <process expanded="true" height="-20" width="-50">
          <operator activated="true" class="text:create_document" compatibility="5.2.003" expanded="true" height="60" name="Create Document" width="90" x="106" y="114">
            <parameter key="text" value="La canción que escuché es hermosa. La estación del tren está llena."/>
          </operator>
          <operator activated="true" class="text:tokenize" compatibility="5.2.003" expanded="true" height="60" name="Tokenize" width="90" x="243" y="115"/>
          <operator activated="true" class="text:replace_tokens" compatibility="5.2.003" expanded="true" height="60" name="Replace Tokens" width="90" x="376" y="113">
            <list key="replace_dictionary">
              <parameter key="á" value="a"/>
            </list>
          </operator>
          <connect from_op="Create Document" from_port="output" to_op="Tokenize" to_port="document"/>
          <connect from_op="Tokenize" from_port="document" to_op="Replace Tokens" to_port="document"/>
          <connect from_op="Replace Tokens" from_port="document" 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>
    Best,
    Nils
  • josejose Member Posts: 16 Contributor II
    thanks Nils,
    is perfect. You are a genius.
Sign In or Register to comment.