PostgreSQL: Index Trigger / Hook? For Synonyms
It's all preprocessing. PostgreSQL can do it's thing. You can do yours.

CREATE INDEX ON myTable 
  USING gin ( myTransform(x) );

SELECT *
FROM myTable
WHERE 'foo &amp; bar' @@ myTransform(x);


Exercise left to the OP,

CREATE FUNCTION myTransform ( x string )
RETURNS tsvector AS $$
  BEGIN
    -- modify x
    RETURN x::tsvector;
  END;
$$ LANGUAGE plpgsql
IMMUTABLE;