Mechanical Turk / Cmd 行工具 / 资格 / xml 中的 #set 和 #foreach

发布于 2024-09-11 15:23:51 字数 631 浏览 0 评论 0原文

在 Amazon Mechanical Turk 命令行工具(我使用的版本:aws-mturk-clt-1.3.0)中,在示例之一(site_filter_qual:“网站过滤资格”,文件 site_filter_qual.question)中,有一些代码看起来像这样的事情:

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

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

我想知道:

  • a)这里使用的语言是什么(它是 不是 Perl 也不是 PHP,对吧?);
  • b) 我在哪里(在亚马逊网站或其他地方) 可以阅读这些结构;
  • c) 如何实现元组(对),例如

// 在 Python 中:

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

-- 或类似的东西?

提前致谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

罪歌 2024-09-18 15:23:51

它是一个 Velocity 模板(Apache 项目的一部分)。好消息是它是一种相当灵活的语言,您可以操作。更好的消息是,您可以(因为我相信所有 CLT 和 SDK 代码都是开放的)实际上创建新的构造来覆盖或扩展不属于 Velocity 开箱即用的任何内容。

直接回答您的问题:

a) Velocity

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

c)您可以使用两个单独的数组。我意识到这并不漂亮,但它会起作用。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文