﻿
WFTM delete segs.au3
19 Dec 2016, Samuel Murray

Suppose you have a WFC TM and you want to mark certain segments as deleted if they contain certain words (i.e. a query).  This script does that.

The script asks you for a search query, and the format is "XXXX:query", i.e. four uppercase letters, a colon, and then the query.  The four letters are the match parameters.

The default parameter set is "TPIN:".

T = search target text
P = search partial words
I = case insensitive
N = don't use regular expressions

The possible options are:

T = search target text
S = search target text

P = search partial words
W = search whole words only (experimental!)

I = case insensitive
C = case sensitive (partially experimental)

N = don't use regular expressions (YMMV)
R = use regular expressions (not supported yet)

So, if you want to search for "over" in the source text, but you don't want to match "rover" or "Over", then your search query string would be "SWCN:over" (source, whole-word, case-sensitive, no-regex, "over").

The script then writes two files, namely a copy of the TM in which all flagged segments are marked as "deleted" by replacing the century with "yy", and a file that contains only the segments that were marked as deleted.

For example, the search query "SWCN:over" will turn this:

20161219~120115	ABC	0	EN-US	The overt rover is over	DE-DE	Der offene Rover ist vorbei

into this:

yy161219~120115	ABC	0	EN-US	The overt rover is over	DE-DE	Der offene Rover ist vorbei

==

The EXE file has no virus, is not merely a launcher for the AU3 file, and supports drag-and-drop.  The AU3 file is the non-compiled version of the script and does not support drag-and-drop.

TODO:
* Specify both source and target language in a single query.
* Write segment with query bracketed e.g. {{over}}.

==

WFC = Wordfast Classic, a translator tool
TM = translation memory, a flat file "database" of translations

==




