English 中文(简体)
Mechanical Turk / Cmd line tools / Qualification / #set and #foreach in xml
原标题:

In the Amazon Mechanical Turk command line tools (I am using version: aws-mturk-clt-1.3.0), in one of the samples (site_filter_qual: "Website Filtering Qualification", file site_filter_qual.question), there is code that looks something like this:

#set( $urls = [ "http://news.bbc.co.uk/", http://..., ...])

#foreach ( $url in $urls )
...

I am wondering :

  • a) What is the language used here (it s not Perl and not PHP, right?);
  • b) Where (on Amazon site or elsewhere) I could read about these constructs;
  • c) How to implement tuples (pairs), e.g.

// in Python:

>> data = [("http://news.bbc.com", "NEWS"), ("http://google.com", "SEARCH"), ...]
>> for (url, category) in data:
>>     ....

-- or something similar?

Thanks in advance!

问题回答

It s a Velocity template (part of the Apache project). The good news is that it s a reasonably flexible language that you can manipulate. The better news is that you can (since I believe all the CLT and SDK code is open) actually create new constructs to override or expand on anything that s not part of Velocity out-of-the-box.

To answer your questions directly:

a) Velocity

b) http://velocity.apache.org/

c) You can use two separate arrays. Not pretty, I realize, but it ll work.





相关问题
Required fields in Mechanical Turk

Is there any way to make fields required in an Amazon Mechanical Turk HIT? I get some blank responses to the textboxes or radiobuttons in my HTML form and the Amazon s documentation doesn t seem to ...

Converting HTML emails to "Well Formed XHTML Code"

I ve trying to submit html emails to amazon s mechanical turk using the questionform xml data scheme. I m having issues converting the html emails into well formed html data. I just input a script ...

Mechanical Turk: Post file to externalSubmit interface?

I have setup my own custom form for mechanical turk and am posting to their external interface. <form enctype="multipart/form-data" action="https://workersandbox.mturk.com/mturk/externalSubmit" ...

热门标签