Customising Okular Text-to-Speech - text-to-speech

My computer details:
OS: Kubuntu 20.04
Okular: 1.9.3
Speech dispatcher: 0.9.1
I am using pico as the tts engine, but cannot find its version.
I want to customise some aspects of Okular's text-to-speech (tts) behaviour. Here are a few examples.
Number
Text: warehouse no. 4
Generated speech: warehouse no {pause for period} four
Desired speech: warehouse number four
Square Brackets
Text: [...]
Generated speech: left square bracket {long pause for three periods} right square bracket
Desired speech: {ignore this without speaking}
How can I achieve this? Where can I do the configuration, in Okular or in speech-dispatcher?
Thanks for the help
Johan

Related

Postgres INSERT returning 'invalid input syntax' for json

Problem: Attempting to insert a JSON string into a Postgres table column of json datatype intermittently returns this error for some record insertion attempts but not others.
I confirmed using multiple third party 'JSON validator' apps that the JSON I am inserting is indeed valid, and I have confirmed that any single ' quote characters have been escaped with the double '' technique, and the issue persists.
What are some additional troubleshooting steps to consider?
Here is a scrubbed sample JSON I have attempted:
{"id": "jf4ba72kFNQ","publishedAt": "2012-09-02T06:07:28Z","channelId": "UCrbUQCaozffv1soNdfDROXQ","title": "Scout vs. Witch: a tale of boy meets ghoul (Official Version)","tags": ["L4D","TF2","SFM","animation","zombies","Valve","video game"],"description": "Howdy folks (he''s alive!). I made a new SFM video (October 2015), called \"Nick in a Hotel Room\". Please check it out: https://www.youtube.com/watch?v=FOCTgwBIun0\n\nAlso check out some early behind the scenes of Scout vs. Witch:\nhttps://www.youtube.com/watch?v=73tQEBgD09I\n\nYou can find links to my stuff on my website: http://nailbiter.net\n\n-----\n\nhey gang,\nI''m the animator who made this cartoon. Hope you like it.\n\nThis is my little mash-up of a bunch of stuff I like. What happens when the Scout from Valve''s Team Fortress 2 video-game walks into the wrong neighborhood (Left 4 Dead). Hilarity (and a bodycount) ensues. It was created using Source Film Maker (for all the dialog stuff and the montage at the beginning), and with TF2/Source SDK for the entire 300 alley-run sequence. I had already completed that part before SFM was released. The big zombie horde scenes and a couple others were shot in Left 4 Dead. I hope you get a kick out of it.\n\nStuff I did:\nI animated all of the characters (using Maya) except for the big crowd scenes and parts of the headcrab zombie (the crawling and the legs). The faces in the dialog scenes were animated in SFM.\n\nAlso did additional mapping, particles, motion graphics, zombie maya rigging, and created blendshapes for the Witch''s face to enable her to talk/emote. I didn''t do a full set, just the phonemes I needed for this performance. Inspiration for her performance was based on Meg Mucklebones (if you''ve ever seen Legend) mixed with the demon ladies in Army of Darkness. I have a feeling Valve had seen those movies too when they designed her..\n\nthanks for watching."}
I am answering this question by enumerating all the other troubleshooting steps I have found so far, either 'working knowledge' that 'field workers' will have, or a little more obscure (or buried in postgres docs which, while thorough, are esoteric) insights I have found thru my own trial & error
Steps
Make sure you have escaped any single quote ' characters by double-escaping with like ''
Make sure your JSON string is actually a single line string - JSON is very easy to copy as a multiline string, and postgres JSON columns will not accept this (easy as hitting backspace on any newline)
Most obscure I've found: even when encapsulated in a JSON string field, the ? question mark weirdly enough breaks the JSON syntax for postgres. Something like {"url": "myurl.com?queryParam=someId"} will return as invalid. Solve this by escaping the question mark like: {"url": "myurl.com\?queryParam=someId"}

How to listen to Tweets that only contains geo-info from Twitter stream

I'm trying to use version 2 of the Twitter API to achieve the goal described in the title. Here's what I have tried so far:
Listening to sample stream (1% of Twitter's stream): Almost all the returned Tweets don't have geo-info when following this approach. And it makes sense, since only 0.85% of all Tweets have geo-info.
Listening to a filtered stream with only one rule setup, namely the has:geo rule. But it's returning the following 2 errors:
"Reference to invalid operator 'has:geo'. Operator is not available in current product or product packaging. Please refer to complete available operator list at https://developer.twitter.com/en/docs/twitter-api/enterprise/rules-and-filtering/operators-by-product. (at position 5)".
"has/is/lang/sample cannot be used as a standalone operator (at position 1)".
Here's the rule I'm adding to the stream:
[
{
"value": "has:geo",
"tag": "contains geo-info",
},
]
I need help in solving both shown errors, or a suggestion describing a third different approach.
I see this question has been discussed on the Twitter Community forum: https://twittercommunity.com/t/how-to-listen-to-tweets-that-only-contains-geo-info-from-twitter-stream/162905/2
Short answer:
The has:geois one of several query operators that can not be used in a standalone fashion, and must be paired with keywords and other non-boolean operators.
The has:geo operator is only available in academic and paid packages.

Google's search operator AND

I am trying to figure out how exactly google's search operator AND works for an application that I am currently building.
I found this article:
https://supple.com.au/tools/google-advanced-search-operators/
that says that google uses AND operator as a default operator when searching
however I am trying some examples and this doesn't seem to be the whole story
For example, when I search for:
Google search term: perth tourism sea surfing
it gives me more search results than:
Google search term: perth tourism sea
How is that possible, I would expect that AND operator would narrow the search results not increase them (this is what I would expect from an OR operator)
Any ideas of why this is happening?
Check this resource out: https://www.webpagefx.com/blog/google-2/google-advanced-search-operators-cheat-sheet/
I have a feeling the default behaviour is and/or, but I am somewhat speculating.
You could incorporate some quotes such as perth tourism "sea surfing" but I might try something such as allintext: perth tourism sea surfing. That would be more machine-friendly than worrying about where to include quotes. Quotes may also constrain the order of your keywords. For example, "I like cats" will find an exact match (and not return pages with I cats like).
Additionally, I think you might not be using AND as it is documented on the site you linked.
The AND operator functions with the same logic as an AND operator - similar to the OR operator, it must be in all CAPS to work. Google will look for all conditions to be met before returning any results.
e.g. site:twitter.com AND intitle:SuppleSolutions AND inurl:Saijo_George where all the 3 conditions should be satisfied for Google to return any result.
Your search terms should probably be:
perth AND tourism AND sea AND surfing
You could add to your logic to replace the search string's characters with AND but before that, I would probably see if allintext: perth tourism sea surfing is viable.
Apparently I think that it is a problem of personalization and localization
I did the following things:
1. I open an incognito window
2. I signed out from all google accounts
3. I opened google.com rather than google.xx using www.google.com/ncr
4. I searched "perth" AND "tourism" AND "sea" and "surfing"
which seems to narrow down the results from searches with less terms.

LyX -- Title, Abstract, Keywords Missing When Using Elsevier Class in View

I'm pretty new to using LyX, but have looked around this forum, as well as others and haven't found anyone else who has encountered this problem.
The issue is that, when I click on the 'eyes' to preview my document in .pdf form, there are the two numbered sections with the corresponding body text, but my title, abstract, and keywords, as well as the 'new page' formatting, are all missing; the two sections are at the top of the page as though they had never been included.
Some pertinent information:
LyX has recently been installed (last couple of weeks)
I'm running OSX 10.9.5
My version of LyX is 2.1.3
I'm using the Elsevier document class
The following is the TeX source:
% Preview source code
%% LyX 2.1.3 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[letterpaper,english]{elsarticle}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth
\makeatother
\usepackage{babel}
\begin{document}
\title{ This is where my title is }
\author{My name}
\begin{abstract}
Abstract: This is my abstarct.\end{abstract}
\begin{keyword}
Keywords: Keyword1, Keyword2, Keyword 3
\end{keyword}
\newpage{}
\section{Introduction}
My intro text
\section{Literature Review}
My body text
\end{document}
Thanks in advance for taking the time to read this and help out!
-Mike
Edit1: After adding \begin{frontmatter}{} and \end{frontmatter}{} before the title and after the keywords, things seem to be working (ie. the title, keywords, abstract and authors are all working) -- does the Elsevier document class force this to be used when denoting these items?
as suggested in the link below:
In the pulldown menu where you set your title text to be the Title, there's entries for BeginFrontmatter and EndFrontmatter. You need to put the first before your title and the second after your keywords.
In the pulldown menu where you set your title text to be the Title, there's entries for BeginFrontmatter and EndFrontmatter. You need to put the first before your title and the second after your keywords.
http://www.latex-community.org/forum/viewtopic.php?f=19&t=24933

Cannot understand Apache Stanbol enhancer response (Semantic Web)

I am new to semantic web and trying to understand. I am using Apache Stanbol
I am seding text to enhance using Restful service and getting a Structure like
ID: enhancement-e7a7f095-d127-0b6f-16db-b89d181c8314
confidence: 0.9877373098687467
created: 2012-03-19T17:01:03.879Z
creator: org.apache.stanbol.enhancer.engines.opennlp.impl.NEREngineCore
end: 1458
extracted-from: content-item-sha1-18a53d775839d36bf1cc220b3a3fa813a6a64593
relation: enhancement-92681e65-f8c8-fb90-aed2-de05f7898ab9
selected-text: Cologne
start: 1451
type: Place,TextAnnotation,Enhancement
What I wanted to ask is what does start, end means? and relation contains a comma seprated list of IDs. How may I access the related IDs using SPARQL
start: The start character position within the plain text version of the parsed content. Note that the plain text version can be
retrieved by using the multi-part content item support of the Stanbol
Enhancer RESTful API.
end: The end character position. This MUST only be present of "fise:start" is also defined.
relation: Specifies that the current fise:Enhancement has a relation to an other fise:Enhancement. Values need to be resources of the "rdf:type" "fise:Enhancement".
from Apache Stanbol online documentation.