<div dir="ltr"><div><div>Hola:<br><br></div>Adjunto un script de corrección automática de diversos errores en oraciones interrogativas.<br><br></div>Funciona a la perfección, aunque los cambios son escasos.<br><div><br></div>
<div>Saludos, Javier</div><div><br></div><div><div>#!/bin/bash</div><div># </div><div># Corrección automática de errores en las traducciones.</div><div># El primer parámetro es la rama ('branches/stable' o 'trunk').</div>
<div># El segundo parámetro es el tipo ('messages' o 'docmessages').</div><div># Es conveniente redireccionar la salida a un archivo.</div><div>#</div><div>PROGRAMA=~/svnroot/pology/scripts/posieve.py</div>
<div>RAIZ=~/svnroot-cop</div><div>IDIOMA=es</div><div>OPCION=find-messages</div><div>PARAMETROS="-s accel:& -s case"</div><div>#-s filter:remove/remove-literals-text -s filter:remove/remove-marlits-text -s filter:remove/remove-fmtdirs-text -s filter:remove/remove-markup-text"</div>
<div><br></div><div># Corrección de tildes en oraciones interrogativas/admirativas</div><div>P[0]="¿cuan\b"<span class="" style="white-space:pre">            </span>R[0]="¿cuán"</div><div>P+=("¿cuando\b")<span class="" style="white-space:pre">        </span>R+=("¿cuándo")</div>
<div>P+=("¿adonde\b")<span class="" style="white-space:pre"> </span>R+=("¿adónde")</div><div>P+=("¿a d[oó]nde\b")<span class="" style="white-space:pre"> </span>R+=("¿adónde")</div><div>
P+=("¿donde\b")<span class="" style="white-space:pre">             </span>R+=("¿dónde")</div><div>P+=("¿cuantas\b")<span class="" style="white-space:pre">      </span>R+=("¿cuántas")</div><div>P+=("¿cuantos\b")<span class="" style="white-space:pre">    </span>R+=("¿cuántos")</div>
<div>P+=("¿cuales\b")<span class="" style="white-space:pre"> </span>R+=("¿cuáles")</div><div>P+=("¿cual\b")<span class="" style="white-space:pre">                </span>R+=("¿cuál")</div><div>P+=("¿quien\b")<span class="" style="white-space:pre">         </span>R+=("¿quién")</div>
<div>P+=("¿quienes\b")<span class="" style="white-space:pre">        </span>R+=("¿quiénes")</div><div>P+=("¿como\b")<span class="" style="white-space:pre">               </span>R+=("¿cómo")</div><div>P+=("¿que\b")<span class="" style="white-space:pre">           </span>R+=("¿qué")</div>
<div>P+=("¿porque\b")<span class="" style="white-space:pre"> </span>R+=("¿por qué")</div><div>P+=("¿por que\b")<span class="" style="white-space:pre">    </span>R+=("¿por qué")</div><div>
P+=("¿haber\b")<span class="" style="white-space:pre">             </span>R+=("¿a ver")</div><div><br></div><div>P+=("¡cuan\b")<span class="" style="white-space:pre">         </span>R+=("¡cuán")</div>
<div>P+=("¡cuando\b")<span class="" style="white-space:pre"> </span>R+=("¡cuándo")</div><div>P+=("¡adonde\b")<span class="" style="white-space:pre">      </span>R+=("¡adónde")</div><div>
P+=("¡a d[oó]nde\b")<span class="" style="white-space:pre">       </span>R+=("¡adónde")</div><div>P+=("¡donde\b")<span class="" style="white-space:pre">               </span>R+=("¡dónde")</div><div>P+=("¡cuantas\b")<span class="" style="white-space:pre">      </span>R+=("¡cuántas")</div>
<div>P+=("¡cuantos\b")<span class="" style="white-space:pre">        </span>R+=("¡cuántos")</div><div>P+=("¡cuales\b")<span class="" style="white-space:pre">     </span>R+=("¡cuáles")</div><div>
P+=("¡cual\b")<span class="" style="white-space:pre">              </span>R+=("¡cuál")</div><div>P+=("¡quien\b")<span class="" style="white-space:pre">         </span>R+=("¡quién")</div><div>P+=("¡quienes\b")<span class="" style="white-space:pre">      </span>R+=("¡quiénes")</div>
<div>P+=("¡como\b")<span class="" style="white-space:pre">           </span>R+=("¡cómo")</div><div>P+=("¡que\b")<span class="" style="white-space:pre">           </span>R+=("¡qué")</div><div>P+=("¡porque\b")<span class="" style="white-space:pre"> </span>R+=("¡por qué")</div>
<div>P+=("¡por que\b")<span class="" style="white-space:pre">        </span>R+=("¡por qué")</div><div>P+=("¡haber\b")<span class="" style="white-space:pre">              </span>R+=("¡a ver")</div><div>
<br></div><div>P+=("¿Cuan\b")<span class="" style="white-space:pre">             </span>R+=("¿Cuán")</div><div>P+=("¿Cuando\b")<span class="" style="white-space:pre">        </span>R+=("¿Cuándo")</div>
<div>P+=("¿Adonde\b")<span class="" style="white-space:pre"> </span>R+=("¿Adónde")</div><div>P+=("¿A d[oó]nde\b")<span class="" style="white-space:pre"> </span>R+=("¿Adónde")</div><div>
P+=("¿Donde\b")<span class="" style="white-space:pre">             </span>R+=("¿Dónde")</div><div>P+=("¿Cuantas\b")<span class="" style="white-space:pre">      </span>R+=("¿Cuántas")</div><div>P+=("¿Cuantos\b")<span class="" style="white-space:pre">    </span>R+=("¿Cuántos")</div>
<div>P+=("¿Cuales\b")<span class="" style="white-space:pre"> </span>R+=("¿Cuáles")</div><div>P+=("¿Cual\b")<span class="" style="white-space:pre">                </span>R+=("¿Cuál")</div><div>P+=("¿Quien\b")<span class="" style="white-space:pre">         </span>R+=("¿Quién")</div>
<div>P+=("¿Quienes\b")<span class="" style="white-space:pre">        </span>R+=("¿Quiénes")</div><div>P+=("¿Como\b")<span class="" style="white-space:pre">               </span>R+=("¿Cómo")</div><div>P+=("¿Que\b")<span class="" style="white-space:pre">           </span>R+=("¿Qué")</div>
<div>P+=("¿Porque\b")<span class="" style="white-space:pre"> </span>R+=("¿Por qué")</div><div>P+=("¿Por que\b")<span class="" style="white-space:pre">    </span>R+=("¿Por qué")</div><div>
P+=("¿Haber\b")<span class="" style="white-space:pre">             </span>R+=("¿A ver")</div><div><br></div><div>P+=("¡Cuan\b")<span class="" style="white-space:pre">         </span>R+=("¡Cuán")</div>
<div>P+=("¡Cuando\b")<span class="" style="white-space:pre"> </span>R+=("¡Cuándo")</div><div>P+=("¡Adonde\b")<span class="" style="white-space:pre">      </span>R+=("¡Adónde")</div><div>
P+=("¡A d[oó]nde\b")<span class="" style="white-space:pre">       </span>R+=("¡Adónde")</div><div>P+=("¡Donde\b")<span class="" style="white-space:pre">               </span>R+=("¡Dónde")</div><div>P+=("¡Cuantas\b")<span class="" style="white-space:pre">      </span>R+=("¡Cuántas")</div>
<div>P+=("¡Cuantos\b")<span class="" style="white-space:pre">        </span>R+=("¡Cuántos")</div><div>P+=("¡Cuales\b")<span class="" style="white-space:pre">     </span>R+=("¡Cuáles")</div><div>
P+=("¡Cual\b")<span class="" style="white-space:pre">              </span>R+=("¡Cuál")</div><div>P+=("¡Quien\b")<span class="" style="white-space:pre">         </span>R+=("¡Quién")</div><div>P+=("¡Quienes\b")<span class="" style="white-space:pre">      </span>R+=("¡Quiénes")</div>
<div>P+=("¡Como\b")<span class="" style="white-space:pre">           </span>R+=("¡Cómo")</div><div>P+=("¡Que\b")<span class="" style="white-space:pre">           </span>R+=("¡Qué")</div><div>P+=("¡Porque\b")<span class="" style="white-space:pre"> </span>R+=("¡Por qué")</div>
<div>P+=("¡Por que\b")<span class="" style="white-space:pre">        </span>R+=("¡Por qué")</div><div>P+=("¡Haber\b")<span class="" style="white-space:pre">              </span>R+=("¡A ver")</div><div>
<br></div><div>P+=("que hora\b")<span class="" style="white-space:pre">   </span>R+=("qué hora")</div><div>P+=("Que hora\b")<span class="" style="white-space:pre">      </span>R+=("Qué hora")</div>
<div><br></div><div>if [[ $1 != '' ]]; then</div><div>  RAMA=$1</div><div>else</div><div>  echo "Debe poner la rama ('branches/stable' o 'trunk') como primer parámetro"</div><div>  exit</div>
<div>fi</div><div><br></div><div>if [[ $2 != '' ]]; then</div><div>  TIPO=$2</div><div>else</div><div>  echo "Debe poner el tipo ('messages' o 'docmessages') como segundo parámetro"</div>
<div>  exit</div><div>fi</div><div><br></div><div>echo "Iniciando...:" $RAMA $TIPO</div><div>ORIGEN=$RAIZ/$RAMA/l10n-kde4/$IDIOMA/$TIPO</div><div>for PAQUETE in $ORIGEN/*; do</div><div>    if [ -d $PAQUETE ]; then</div>
<div><span class="" style="white-space:pre">    </span>echo "Procesando...:" $PAQUETE</div><div><span class="" style="white-space:pre">   </span>for ((I=0; I<${#P[@]}; I++)); do</div><div><span class="" style="white-space:pre">        </span>    # echo "Analizando...:" "${P[$I]}"</div>
<div><span class="" style="white-space:pre">    </span>    $PROGRAMA '-bR' $OPCION $PARAMETROS -s msgstr:"${P[$I]}" -s replace:"${R[$I]}" $PAQUETE</div><div><span class="" style="white-space:pre">  </span>done</div>
<div>    fi</div><div>done</div></div><div><br></div></div>