mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Read "everything except", "from the map", a doubled verb and a grid reference after "near"
"hide everything except flights" (or "all but", "other than") switches off
every layer that is on but the ones named, or says no other layers are on.
"remove flights from the map" is "remove flights", "hide hide everything"
reads the verb once, and "flights near 14R PU 2090 4906" flies to the grid
reference. A keyword that begins a name ("Fire Island", "Radio City Music
Hall") no longer offers a plan to the rest of the name. The arrow keys drop
a check for a list that opens upward, which it never does.
Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
91700f89f8
commit
dc31774109
18 files changed
+172
-8
No files matched your search
@@ -9,6 +9,7 @@
|
||||
// entity comes last.
|
||||
|
||||
import { msg } from '../i18n/index.js';
|
||||
import { parseCoordinateQuery } from '../search/coordinateParser.js';
|
||||
|
||||
/** Visual styles, by the words people use for them. */
|
||||
const STYLES = [
|
||||
@@ -286,6 +287,11 @@ export function normalizeLine(text, { isRequest = isPlainRequest } = {}) {
|
||||
.trim();
|
||||
const end = /(?<!(?:^|[\s.])\p{L})[.!。]+$/u;
|
||||
line = line.replace(end, '');
|
||||
// A verb typed twice ("hide hide everything") is one.
|
||||
line = line.replace(
|
||||
/^((?:turn|switch) (?:on|off)|show|hide|remove|enable|disable|clear|go to|fly to)\s+\1\b/i,
|
||||
'$1',
|
||||
);
|
||||
// "please" is dropped only around a request: "Please Touch Museum",
|
||||
// "Kindly Lane" and "Pretty Please" are names.
|
||||
const polite = line
|
||||
@@ -903,6 +909,11 @@ export function parseOmnibar(
|
||||
const unasked = steps.length > 0 && steps.every((step) => !asked.has(step));
|
||||
if (place && !placeFrom) placeFrom = placeBare ? 'bare' : 'near';
|
||||
if (place) {
|
||||
// A grid reference is read only as typed ("14R PU 2090 4906"; in lower
|
||||
// case it may be words), so the plan keeps it so.
|
||||
const typed = asTypedIn(raw, place);
|
||||
if (!parseCoordinateQuery(place) && parseCoordinateQuery(typed))
|
||||
place = typed;
|
||||
const step = { kind: 'place', place };
|
||||
// How the place was typed, for its label only ("İstanbul", "iPhone
|
||||
// store"); kept off the step's fields, which plans compare.
|
||||
|
||||
Reference in new issue
Block a user