// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*- // // This file is part of Genie // // Copyright 2021 The Board of Trustees of the Leland Stanford Junior University // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Author: Giovanni Campagna import * as $runtime from "../sentence-generator/runtime"; import type $SentenceGenerator from "../sentence-generator/generator"; import * as $SentenceGeneratorTypes from "../sentence-generator/types"; import * as $I18n from "../i18n/index"; import { Ast, } from 'thingtalk'; import * as C from './ast_manip'; import ThingpediaLoader from './load-thingpedia'; export const same_sentence_coref : $SentenceGeneratorTypes.NonTerminal = "same_sentence_coref"; export const context_coref : $SentenceGeneratorTypes.NonTerminal = "context_coref"; export const list_context_coref : $SentenceGeneratorTypes.NonTerminal = "list_context_coref"; export const the_base_table : $SentenceGeneratorTypes.NonTerminal = "the_base_table"; /** * Load the templates in this file. * * This is an autogenerated method that will be called by the {@link SentenceGenerator} * when the templates are imported. */ export async function $load($options : $SentenceGeneratorTypes.GrammarOptions, $locale : $I18n.LanguagePack, $grammar : $SentenceGenerator, $loader : ThingpediaLoader) : Promise { $grammar.declareSymbol("same_sentence_coref"); $grammar.addRule("same_sentence_coref", [], $locale._("it"), (() : (any)|null => "it"), undefined, { identity: (true) }); $grammar.addRule("same_sentence_coref", [], $locale._("them"), (() : (any)|null => "them"), undefined, { identity: (true) }); $grammar.declareSymbol("context_coref"); $grammar.addRule("context_coref", [], $locale._("it"), (() : (any)|null => "it"), undefined, { identity: (true) }); $grammar.addRule("context_coref", [], $locale._("this"), (() : (any)|null => "this"), undefined, { identity: (true) }); $grammar.addRule("context_coref", [], $locale._("that"), (() : (any)|null => "that"), undefined, { identity: (true) }); $grammar.declareSymbol("list_context_coref"); $grammar.addRule("list_context_coref", [], $locale._("either one"), (() : (any)|null => "either one"), undefined, { identity: (true) }); $grammar.addRule("list_context_coref", [], $locale._("either of them"), (() : (any)|null => "either of them"), undefined, { identity: (true) }); $grammar.addRule("list_context_coref", [], $locale._("any of them"), (() : (any)|null => "any of them"), undefined, { identity: (true) }); $grammar.addRule("list_context_coref", [], $locale._("any one of them"), (() : (any)|null => "any one of them"), undefined, { identity: (true) }); $grammar.declareSymbol("the_base_table"); $grammar.addRule("the_base_table", [new $runtime.NonTerminal("base_table", "table", undefined)], $locale._("the ${table}"), ((table : Ast.InvocationExpression) : (Ast.InvocationExpression)|null => table), C.expressionKeyFn, { }); };