Trados Studio
Trados GroupShare
Trados Business Manager
Trados Live
MultiTerm
Passolo
Speech to Text
Managed Translation - Enterprise
MultiTrans
TMS
Translation Management Connectors
WorldServer
LiveContent S1000D
Contenta S1000D
XPP
Tridion Docs
Tridion Sites
Machine Translation Cloud
Machine Translation Connectors
Machine Translation Edge
Language Developers
Tridion Docs Developers
Xopus Developers
Community Help
RWS User Experience
RWS Community Internal Group
RWS Access Customer Portal
RWS Professional Services
RWS Training & Certification
Style Guides
Language Technology Partner Group
RWS Enterprise Technology Partners
Trados Academic Partners
Trados Approved Trainers
XyUser Group
ETUG (European Trados User Group) Public Information
Machine Translation User Group
Nordic Tridion Docs User Group
Tridion Docs Europe & APAC User Group
Tridion UK Meetup
Tridion User Group Benelux
Tridion User Group New England
Tridion User Group Ohio Valley
Tridion West Coast User Group
WorldServer User Group
MultiTerm Ideas
Passolo Ideas
Trados GroupShare Ideas
Trados Studio Ideas
Language Weaver Cloud Ideas
Language Weaver Edge Ideas
RWS Language Cloud TMS Ideas
RWS Language Cloud Terminology Ideas
RWS Language Cloud Online Editor Ideas
Managed Translation - Enterprise Ideas
TMS Ideas
WorldServer Ideas
Tridion Docs Ideas
Tridion Sites Ideas
LiveContent S1000D Ideas
XPP Ideas
Events & Webinars
To RWS Documentation
To RWS Support
Detecting language please wait for.......
Hi,
I have a question with the array resetting after the end of the frill processing.
Originally, I planned to use an array to store texts on each page for indexing. The result is perfect when composing only one page. Unfortunately, when composing more than a page (compose range(+)), the array on each page has changed. I wonder if this is caused by the variables from the next page moved to the previous page for pagination checking.
I have undef the array at the end of the frill processing but the issue still exists. Can anyone point me in the right direction?
Regards,
Terrence
Terrence,
Not sure. I think the danger is bigger when the <index> tag is glued against the previous word.A thing which you can prevent by using the '!' preprocess operator.(not sure if that…
Still insufficient information. You didn't provide any extracts of your Perl code nor provide any detailed explanations regarding the questions Bart asked about. How do you separate the "index" entries…
I just went through the trouble to build my own test job to see if I can duplicate your problem.
And I can't.Everything works without a problem on my system.I just entered some text on a…
Hi Terrence,
Just like Jonathan I have trouble understanding exactly what you are asking.
I guess that the 'array' you are talking about is a perl array? Correct?But you will have to give us a lot of more info before we can help you.Maybe some extracts of your code might help.Also a bit more explanation on what and how you put things into the array and how and where you read them back out.
Regards
Bart
Hi Jonathan & Bart,
Thanks for your response. Let me rephrase the question.
I have a division in which some pages contain tagged text <index>..</index> and I use an array (@index) to store all the captured text and print it to an index page.
On page 1:%<index>Index 1</index>The following are the details ...
On page 2:%We provide property developers, <index>Index 2</index>property owners and <index>Index 3</index>residents with a variety of property management services ...
The result is perfect when composing only one page, i.e. @index on page 1 contains Index 1 whereas @index on page 2 contains Index 2 and Index 3. However, when composing Whole Division, @index on page 1 contains not only Index 1, but also Index 2 and Index 3. @index on page 2 also contains Index 2 and Index 3. Is there any solution to prevent this from happening?
Still insufficient information. You didn't provide any extracts of your Perl code nor provide any detailed explanations regarding the questions Bart asked about. How do you separate the "index" entries that are from different pages when they are being being written to the array (or is that your problem because you are not doing that)?
I'm going to defer to Bart's Perl expertise.
Yes Terrence,
Like Jonathan said already, we need to see actual code in order to help you.In theory there should be no problem with what you are trying to achieve.But the devil is sometimes in the detail.(like are you using 'our' or 'my' variables, how/when are you trying to empty the arrary, how do add entries onto the array, ...?)
I defined the <index>..</index> macros to call a xyPerl function with the 'i' mode flag set, because of the multiple occurrences of the <index> on the same page, and every occurrence has been pushed onto the array. During the frill processing, I shift each index item every time when it hit a line with an <index> and undef the @index at the end of the frill processing to make it ready for the next page.
In order to pass the array to frill processing, I use 'our' for the array (@index), but use 'my' for the variable for each captured text from perl and undef the array at the end of the frill processing.
Belows are extract of the codings and how it undef the array
##################$X -> open_db("first","main","stream"); if(open_ok) { $X->open_db("first","main","block"); if(open_ok) { $X->open_db("first","main","line"); } } while(open_ok) { if(db("flag")) { my $temp = shift @index; # Do something } $X->open_db("next","main","line"); if(!open_ok){ $X->open_db("next","main","block"); } } # end while undef @index;
###################
Regards,Terrence
Do the frills processing function and the function that you use to push index terms onto the @index live in the same package?Do you call both functions using the 'p' (persistent) flag?Can you try what happens when you explicitly empty the array:@index = (); (instead of undef it)
Hi Bart,
Yes, both functions are in the same package and 'p' flag is using when calling perl function.
The result is the same when using @index = () instead of using undef.