Skip to content

Commit

Permalink
Add False Friends
Browse files Browse the repository at this point in the history
  • Loading branch information
kaubu committed Dec 17, 2023
1 parent 288c771 commit 3f9be58
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 57 deletions.
45 changes: 22 additions & 23 deletions src/components/SearchResult.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
<!-- eslint-disable vue/no-unused-vars -->
<template>
<!-- False friends -->
<div
v-if="searchedWord.toLowerCase() in (falseFriends ?? {})"
class="mb-6"
>
<h2><u><center>False Friend</center></u></h2>
<v-card class="mt-2">
<v-card-item>
<v-card-title>
{{ searchedWord.toLowerCase() }}
</v-card-title>
</v-card-item>
<v-card-text>
<p v-html="falseFriends[searchedWord.toLowerCase()]"></p>
</v-card-text>
</v-card>
</div>
<!-- Germanic English alternatives -->
<div
v-if="searchedWord in englishToGermanicDictionary ||
Expand Down Expand Up @@ -333,7 +353,7 @@ import { onMounted, toRaw, watch } from "vue";
import { getCurrentInstance } from "vue";
import { Ref, computed, ref } from "vue";
import { useRoute } from "vue-router";
// import Fuse from 'fuse.js';
import { falseFriends } from "@/variables";
const store = useAppStore();
const {
Expand All @@ -350,28 +370,6 @@ const emptyAnglishFuzzyResults: Array<AnglishToEnglishEntry> = [];
const anglishFuzzyResults: Ref<Array<AnglishToEnglishEntry>> = ref([]);
const anglishExactResults: Ref<Array<AnglishToEnglishEntry>> = ref([]);
// const fuseOptions = {
// // isCaseSensitive: false,
// // includeScore: false,
// // shouldSort: true,
// // includeMatches: false,
// // findAllMatches: false,
// // minMatchCharLength: 1,
// // location: 0,
// // threshold: 0.6,
// // distance: 100,
// // useExtendedSearch: false,
// // ignoreLocation: false,
// // ignoreFieldNorm: false,
// // fieldNormWeight: 1,
// keys: [
// "word.pos.word",
// "word.pos.anglish_spelling",
// "word.pos.definitions",
// ]
// }
// const fuse = new Fuse(anglishToEnglishDictionary.value, fuseOptions);
async function refreshSearch() {
anglishFuzzyResults.value = structuredClone(emptyAnglishFuzzyResults);
anglishExactResults.value = structuredClone(emptyAnglishFuzzyResults);
Expand Down Expand Up @@ -492,6 +490,7 @@ const instance = getCurrentInstance();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
watch(route, (_to, _from) => {
console.log("Force updated!");
refreshSearch();
instance?.proxy?.$forceUpdate();
});
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/default/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ onMounted(() => {
if (e.code === "KeyS"
&& (document.activeElement !== searchBar)
&& (document.activeElement?.id !== "wordlistSearch")) {
console.log(`Focusing search! activeElement = ${document.activeElement?.id}`);
// console.log(`Focusing search! activeElement = ${document.activeElement?.id}`);
searchBar?.focus();
// Unfocus the search bar if escape is pressed
} else if (e.code === "Escape" && (document.activeElement === searchBar)) {
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export interface GermanicDictionary {
[word: string]: GermanicEntries,
}

export interface FalseFriends {
[friend: string]: string
}

/**
* {
* "a": {
Expand Down
34 changes: 34 additions & 0 deletions src/variables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { FalseFriends } from "./types";

export const falseFriends: FalseFriends = {
"arm": `Means "poor" in all senses. Its likeness to the word for the bodily limb is a coincidence, as is its likeness to "arm" that means "weapon", as that <i>arm</i> is from French and is the source of the "arm" in "firearm".`,
"boot": `Means "remedy". It is still found in the phrase "to boot". The modern word (referring to footwear) appears to have come from French.`,
"bound": `In English, "bound" is in truth, six different words of three different origins. The noun "bound" as in "out of bound", "boundary" comes from Old French; so is the verb <i>to bound</i> in the meaning of forming a boundary / a surrounding. Another French borrowing that came to the same shape (noun and verb) carries the meaning of jumping, or causing something to "rebound". "Bound" in the meaning of "likely to" or "prepared" is of Northish upspring. At last, "bound" as the past tense and past participle of <i>to bind</i> is fully Anglo-Saxon.`,
"cost": `Means "choice", or a "means", <i>a way to do something</i>. It is related to the word "choose" and is apparently a Scandinavian borrowing.`,
"deal": `Means "part". This is the old meaning of the word, and some trace of it can be found in phrases like "a great deal" and "deal out the cards".`,
"deer": `Means "animal". This is the old meaning of the word before it was narrowed down to just one kind of animal. This kind of animal is called a "hart" in Anglish.`,
"doom": `Means "judgement", as in "doomsday", the day of judgement. This is the old meaning of the word and is related to the verb "deem", in which the original meaning of "doom" is far more apparent.`,
"dutch": `This word can refer to Germans and any other mainland West Germanic speakers. This is an older meaning which can still be seen in the term "Pennsylvania Dutch", "Dutch angle" and the American nickname "Dutch" for a German.`,
"fang": `Means "catch" as a verb. The ordinary word <i>fang</i> is a noun and had the broader meaning of "instrument for catching".`,
"fast": `Means "firm, secure". This is the word's older meaning, and it is still found in words like "steadfast", "fasten", and "fast friends".`,
"fax": `Means "head-hair". It is still found in the surname "Fairfax", which means "fair-haired", and the name of the horse "Shadowfax" from The Lord of the Rings, meaning "grey-haired". The modern word "fax" is of unlike origin, as it is short for "facsimile" (a Latin formation).`,
"form": `Means "original, primal". It has no connection to "form" meaning "external appearance"; instead, it is akin to the adjectives "former" and "foremost".`,
"lax": `Means "salmon" (a kind of fish). It has no connection to the latinate word "lax" (meaning the opposite of "strict"), as in "relax".`,
"lease": `Means "gather, glean", and since it rhymes with <i>please</i>, it is pronounced differently from the ordinary word <i>lease</i> (which is from French).`,
"man": `Means "human". This old meaning is still seen in terms like <i>mankind</i> and <i>businessman</i>.`,
"mean": `Means "common", "shared". This is the old meaning of the word.`,
"more": `Means "root" (like a carrot's or a parsnip's). It has no relation to "more" used as an adjective and an adverb.`,
"neat": `The modern English adjective is of French origin, and displaced a homophonous native noun of meaning "cattle".`,
"near": `Means "to save". Revived from early Middle English <i>nerian</i>.`,
"note": `Means "use" and "usage". The modern word "note" is an Old French borrowing.`,
"ore": `Means "honour". The "ore" with the usual, metallic meaning is unrelated.`,
"other": `This word can mean "second" (as in "after first"). This is an old meaning of the word, as in, "First, other, third."`,
"saw": `The noun counterpart of the verb "say". Thus, it means "what is said" and is commonly found in the phrase "old saw" (wherein "saw" means "saying, proverb"). The word "saga" is a learned borrowing of its Old Norse cognate. The modern word "saw" referring to the tool is unrelated.`,
"sax": `This word can mean "short sword", "dagger", "knife", and "Saxon". The modern word <i>sax</i> (shortening of <i>saxophone</i>) is distantly akin to this <i>sax</i>, since it is named after Adolphe Sax, whose last name is a variant of <i>Sachs</i> (meaning <i>man of Saxony</i>). An unstressed variant of <i>sax</i> appears in place names like <i>Wessex</i> and <i>Essex</i>.`,
"sicker": `If you are sick, you may feel sicker tomorrow. However, that is unrelated to another <i>sicker</i>. This word, which is an adjective, was an early Anglo-Saxon borrowing (like <i>Monk</i> or <i>Tile</i>). <i>Secure</i> is a doublet of this but this came much later and from French. In some older sayings from New English this word is used, such as "Take the sicker path" and essentially means safe or dependable.`,
"sound": `It's an adjective with the basic meaning of "healthy", also met in the expressions like "sound advice" or "safe and sound". It's unrelated to the noun "sound", which was borrowed from from French and displaced the native word "swey".`,
"sum": `Other words on the False Friends list are given in their New English spellings, but this one might be a false friend if you're using the Anglish spelling. Everyday English word <i>some</i> in the Anglish spelling becomes <i>sum</i>, which in English is the spelling for an unrelated latinate word.`,
"suttle": `This word may look and sound like "subtle" (which is from French), but it is unrelated. <i>Suttle</i> means "obvious" and it has been revived from Middle English <i>sutel</i>.`,
"wife": `This word can mean "woman". This old meaning is still seen in the words <i>midwife</i> and <i>goodwife</i>. The word <i>woman</i> itself is a shortening of <i>wife-man</i>, where <i>wife</i> means <i>female</i> and <i>man</i> means <i>human</i> (see the entry for <i>Man</i>). The male equivalent to wife was often "were", known today in the word "were-wolf" (man-wolf), similar to the word wife, in that it could mean both "a man" and "a <i>married</i> man". Read: "<i>a</i> wife" / "<i>a</i> were" / "<i>a</i> man" vs. "<i>my</i> wife" / "<i>my</i> were" / "<i>my</i> man".`,
"wood": `This word can mean "fury", "madness", "anger" as a noun, and "mad" as an adjective. This meaning is akin to the first segment of <i>Wednesday</i>, as that day is named after a "wooden god".`,
};
2 changes: 1 addition & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<p><sub>This project is still in progress, expect errors.</sub></p>

<p><sub>v1.5.1 (2023-12-17)</sub></p>
<p><sub>v1.6.0 (2023-12-17)</sub></p>
</center>
</template>

Expand Down
32 changes: 0 additions & 32 deletions src/views/Search.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<template>
<!-- <h1>Search</h1>
<p>Searching for '{{ $route.query.word }}'</p> -->
<v-main class="fill-height bg-grey-lighten-3">
<v-container>
<v-row justify="center">
<v-col cols="12" md="4">
<!-- <SearchResult
:anglishEnglishWord="getAnglishAlternatives($route.query.word?.toString() ?? '')"
/> -->
<!-- <SearchResult :searchedWord="$route.query.word?.toString() ?? ''"/> -->
<SearchResult/>
</v-col>
</v-row>
Expand All @@ -18,30 +12,4 @@

<script setup lang="ts">
import SearchResult from '@/components/SearchResult.vue';
// Empty EnglishToAnglish dict
// const englishToAnglishDictionary: Ref<EnglishToAnglish> = ref({
// "english_word": {
// "pos": [{
// anglish_word: "",
// anglish_spelling: "",
// definitions: "",
// forebear: "",
// taken_from: "",
// notes: "",
// }]
// }
// });
// fetch("/english_to_anglish.json").then((a) => {
// a.json().then((data: EnglishToAnglish) => {
// englishToAnglishDictionary.value = data;
// console.log("Loaded words!");
// })
// });
// function getAnglishAlternatives(englishWord: string): EnglishWord {
// // console.log(`value = ${JSON.stringify(englishToAnglishDictionary.value)}`);
// return englishToAnglishDictionary.value[englishWord];
// }
</script>

0 comments on commit 3f9be58

Please sign in to comment.