"Christoph Kaufmann" <clk@tele2.ch> wrote in message news:1j1bjme.e5cchg17d94fwN%clk@tele2.ch...
G. Adriaan Barthol <gabarthol@gmail.com> wrote:
Mainly, I wish to generate two types of reports:
1 - Test report (where the "keyword" is replaced by underscores)
e.g. Hier soir, l'OM a _____ le PSG. beaten
2 - Solution report (where the "keyword" is printed in an other colour
in the sentence)
e.g. Hier soir, l'OM a "battu" le PSG. beaten
Make calculated fields for the test and for the solution sentences. Make the calculation "text result" and explore the text functions.
Text functions will allow you to calculate how many words are placed
before the keyword, and how many words are placed after the keyword. Knowing that, you can build the test sentence.
In order to avoid complicated functions (with functions inside
functions), you can use more calc fields or try the "let" function.
Good luck.
I don't know about changing the colour, but putting in the underscores is easy using the Substitute function in a Calculation field (no need for a Script).
e.g.
Test Sentence Calculation, Text Result, Unstored
= Substitute(Sentence, Keyword, "____________")
This will replace all occurences of the Keyword within the sentence with the underscores.
If needed, you could use the Left function to replace the Keyword letters with the same number of underscore and space characters (to let people know how many letters the missing word has).
e.g.
Test Sentence Calculation, Text Result, Unstored
= Substitute(Sentence, Keyword, Left("_ _ _ _ _ _ _ ", Length(Keyword) * 2 - 1))
where the "_ _ _ _ _ " text contains enough underscore and space pairs to replace the longest possible Keyword.
In article <h13ork$9pg$1@lust.ihug.co.nz>, Your Name
<your.name@isp.com> wrote:
"Christoph Kaufmann" <clk@tele2.ch> wrote in message
news:1j1bjme.e5cchg17d94fwN%clk@tele2.ch...
G. Adriaan Barthol <gabarthol@gmail.com> wrote:
Mainly, I wish to generate two types of reports:
1 - Test report (where the "keyword" is replaced by underscores)
e.g. Hier soir, l'OM a _____ le PSG. beaten
2 - Solution report (where the "keyword" is printed in an other colour >>>> in the sentence)
e.g. Hier soir, l'OM a "battu" le PSG. beaten
Make calculated fields for the test and for the solution sentences. Make >>> the calculation "text result" and explore the text functions.
Text functions will allow you to calculate how many words are placed
before the keyword, and how many words are placed after the keyword.
Knowing that, you can build the test sentence.
In order to avoid complicated functions (with functions inside
functions), you can use more calc fields or try the "let" function.
Good luck.
I don't know about changing the colour, but putting in the underscores is
easy using the Substitute function in a Calculation field (no need for a
Script).
e.g.
Test Sentence Calculation, Text Result, Unstored
= Substitute(Sentence, Keyword, "____________")
This will replace all occurences of the Keyword within the sentence with the >> underscores.
If needed, you could use the Left function to replace the Keyword letters
with the same number of underscore and space characters (to let people know >> how many letters the missing word has).
e.g.
Test Sentence Calculation, Text Result, Unstored
= Substitute(Sentence, Keyword, Left("_ _ _ _ _ _ _ ",
Length(Keyword) * 2 - 1))
where the "_ _ _ _ _ " text contains enough underscore and space pairs to
replace the longest possible Keyword.
Ha! Your Name, Your Advice has seeded the future!
Rather than simply ask a question I decided (being smart for once) to
do a search, and the answer I needed was right there (or here), thanks
to you. Perfect!
I salute you, long after the (original) event as it is.
Nikki
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 47:15:19 |
Calls: | 6,648 |
Files: | 12,198 |
Messages: | 5,329,924 |