Skip to content

Instantly share code, notes, and snippets.

View powerdot's full-sized avatar
🦁

powerdot

🦁
View GitHub Profile
//inject moment.js
$('body').append("<script src='https://momentjs.com/downloads/moment.js'></script>")
//script
var last_ts = 0;
var mid = 0;
var mid_q = 0;
var mid_h = 0;
var count = 0;
var long = 0;
{
name: "Триггер включения света",
words: [
{text: "включить"},
{text: "свет"},
],
markers: ['light_on'],
strict_word_sequence: false,
strict_word_direction: true,
check_scope: 'sentences'
{
name: "Триггер включения света",
words: [
{normalized: "включить"},
{text: "свет"},
],
markers: ['light_on'],
strict_word_sequence: false,
strict_word_direction: true,
check_scope: 'sentences'
{
name: "Триггер включения света",
words: [
{normalized: "включить"},
{text: ["свет", "лампа", "светильник"]},
],
markers: ['light_on'],
strict_word_sequence: false,
strict_word_direction: true,
check_scope: 'sentences'
{
name: "Триггер на включение музыки",
words: [
{normalized: ["включить", 'запустить', 'возобновить']},
{normalized: ['песня', 'музыка', 'трек']},
],
markers: ['music_on'],
strict_word_sequence: false,
strict_word_direction: true,
check_scope: 'sentences'
let triggers = [
{
name: "Приветсвие",
words: [{text: ["привет", "хелоу", "здарова", "хай", "прив"]}],
markers: ['hi'],
check_scope: 'sentences'
},
{
name: "Вопрос о времени работы",
words: [
let triggers = [ ... ];
let Analysis = require("russian-text-tagger")({triggers, uniq_markers: true});
async function Check(text){
let results = await Analysis(text);
console.log(results);
}
<script src="./az.min.js"></script>
<script src="./RTT/index.js"></script>
<script>
let triggers = [ ... ];
Az.Morph.init('./dicts', function(){
let Analysis = RussianTextTagger({triggers, loadedAz: Az, uniq_markers: true});
let result = Analysis("здесь текст для тэггера");
console.log(result);
<template>
<block-content>
<!-- Insert block content -->
<propertyPopup title="Property title">
<!-- Insert elements for setup -->
</propertyPopup>
</block-content>
</template>
<script>
<template>
<div class="container">
<block-editor :layout="{ menu: true, propertyEditor: true, history: false, editor: true }">
</block-editor>
</div>
</template>
<script>
import BlockEditor from "vue-block-editor";
import 'vue-block-editor/dist/BlockEditor.css';