Skip to content

Commit

Permalink
Modify parameter passing for pronouns replacing
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnychhsu committed Mar 6, 2019
1 parent 2c49fd6 commit fba5bdf
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions languages/zh-tw/parameters.genie
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,23 @@ for (let [pname, typestr] of $options.params.in.values()) {
action_replace_param_with_stream = a:thingpedia_action p:$('single_stream_projection_' + typestr) [-> pname] => C.actionReplaceParamWithStream(a, pname, p);

if ($options.types.id.has(typestr)) {
forward_get_do_command = command:forward_get_do_command [-> pname] => {
forward_get_do_command = command:forward_get_do_command '他' [-> pname] => {
for (let joinArg in command.table.schema.out) {
if (typestr === C.typeToStringSafe(command.table.schema.out[joinArg]))
return C.getDoCommand(command, pname, new Ast.Value.VarRef(joinArg));
}
return null;
};

forward_when_do_rule = rule:forward_when_do_rule [-> pname] => {
forward_when_do_rule = rule:forward_when_do_rule '他' [-> pname] => {
for (let joinArg in rule.stream.schema.out) {
if (typestr === C.typeToStringSafe(rule.stream.schema.out[joinArg]))
return C.whenDoRule(rule, pname, new Ast.Value.VarRef(joinArg));
}
return null;
};

when_get_stream = stream:when_get_stream [-> pname] => {
when_get_stream = stream:when_get_stream '他' [-> pname] => {
for (let joinArg in stream.stream.schema.out) {
if (typestr === C.typeToStringSafe(stream.stream.schema.out[joinArg]))
return C.whenGetStream(stream, pname, new Ast.Value.VarRef(joinArg));
Expand All @@ -220,13 +220,13 @@ for (let [pname, typestr] of $options.params.in.values()) {
}

if (pname === 'p_picture_url') {
forward_get_do_command = command:forward_get_do_command [-> pname] => C.getDoCommand(command, pname, new Ast.Value.VarRef('picture_url'));
forward_when_do_rule = rule:forward_when_do_rule [-> pname] => C.whenDoRule(rule, pname, new Ast.Value.VarRef('picture_url'));
when_get_stream = stream:when_get_stream [-> pname] => C.whenGetStream(stream, pname, new Ast.Value.VarRef('picture_url'));
forward_get_do_command = command:forward_get_do_command '他' [-> pname] => C.getDoCommand(command, pname, new Ast.Value.VarRef('picture_url'));
forward_when_do_rule = rule:forward_when_do_rule '他' [-> pname] => C.whenDoRule(rule, pname, new Ast.Value.VarRef('picture_url'));
when_get_stream = stream:when_get_stream '他' [-> pname] => C.whenGetStream(stream, pname, new Ast.Value.VarRef('picture_url'));
}

if (typestr === 'String' && ['p_body', 'p_message', 'p_caption', 'p_status', 'p_text'].indexOf(pname) >= 0) {
forward_get_do_command = command:forward_get_do_command [-> pname] => {
forward_get_do_command = command:forward_get_do_command '他' [-> pname] => {
for (let pname in command.table.schema.out) {
if (pname === 'picture_url')
return null;
Expand All @@ -237,7 +237,7 @@ for (let [pname, typestr] of $options.params.in.values()) {
return C.getDoCommand(command, pname, new Ast.Value.Event(null));
};

forward_when_do_rule = rule:forward_when_do_rule [-> pname] => {
forward_when_do_rule = rule:forward_when_do_rule '他' [-> pname] => {
for (let pname in rule.stream.schema.out) {
if (pname === 'picture_url')
return null;
Expand All @@ -248,7 +248,7 @@ for (let [pname, typestr] of $options.params.in.values()) {
return C.whenDoRule(rule, pname, new Ast.Value.Event(null));
};

when_get_stream = stream:when_get_stream [-> pname] => {
when_get_stream = stream:when_get_stream '他' [-> pname] => {
for (let pname in stream.stream.schema.out) {
if (pname === 'picture_url')
return null;
Expand Down

0 comments on commit fba5bdf

Please sign in to comment.