1. A method for replacing in a document a source string with a target string, comprising: morpho-syntactically disambiguating textual content of the document; identifying a set of string dependencies by detecting grammatical or anaphoric dependencies, or both, between strings in the textual content of the document; disambiguating one or more of gender, number, or part of speech with user specifications when the source string or the target string have more than one possible meaning; identifying occurrences of the source string in the document that satisfy the user specifications; identifying string relations from the set of string dependencies that define direct or indirect links, or both, to the source string; replacing each occurrences of the source string in the document that satisfy the user specifications with the target string; correcting grammatical or anaphoric inconsistencies, or both, in the string relations in the document that are introduced when the source string is replaced with the target string; and outputting the document.