December 11, 201114 yr Hello I have a situation that I would like to make a calculation to pick a random word in a sentence of varying length change it to a "_______" and paste in the field "missing word" . I don't know if this is possible because of the length of the sentence being variable . Also since this will be used for an english drill I would be looking for words longer than 4 letters. This may be too difficult. But thanks for answers Ps If the word didn't look like the best choice to restore to original sentence and try again. More Thanks
December 11, 201114 yr Hello journeyman, It sounds like you want the Substitute() function. Assume your text is in a field called Text and you use a global text field called gString where you type in the phrase or words you wish to find in the text. Then calculation (result is text) would be: Substitute ( Text ; gString ; "missing word" ) I didn't get the underline part. Maybe an example will help us pin down a calculation for you. :-)
December 13, 201114 yr Author Thank you so much. That is exactly what I am looking for. But I would like to have the "_______" to show up without the last letter. I can't figure it out . _______ instead of ______s etc. Thanks so much Is it possible the calculation could overlook certain words if I could put in a list? Like "the" "be" "Matthew" etc?
December 13, 201114 yr Comment's file works perfectly for me. Can you post the calculation you are using?
December 13, 201114 yr Author I am using the calc that comment posted because it works so well with the exceptions I just mentioned. Thanks I hope comment will amend the calc so I can get rid of the last letter on the "________" (blank)
December 13, 201114 yr Please post an example of a sentence and word number that produce the problem.
December 13, 201114 yr Author I am so sorry - My sentences had quotations around them and that caused the problem. I still wish there was a way to use your file but not use certain words that i could make a list of that would become random.
December 13, 201114 yr try to add: and IsEmpty ( FilterValues ( ValueListItems ( Get ( FileName ) ; "YourValueList" ) ; MiddleWords ( Sentences::Sentence ; $n ; 1 ) ) ) to the calculation for the Exit Loop If [ ] script step. P.S.: YourValueList is the name of the value list of the exceptions.
Create an account or sign in to comment