mirror of
https://github.com/AventurasTeam/Aventuras.git
synced 2026-04-26 10:51:24 +00:00
Added harper
This commit is contained in:
parent
50430a43f4
commit
c33eb3c49c
7 changed files with 487 additions and 0 deletions
7
package-lock.json
generated
7
package-lock.json
generated
|
|
@ -14,6 +14,7 @@
|
||||||
"@tauri-apps/plugin-fs": "^2",
|
"@tauri-apps/plugin-fs": "^2",
|
||||||
"@tauri-apps/plugin-opener": "^2",
|
"@tauri-apps/plugin-opener": "^2",
|
||||||
"@tauri-apps/plugin-sql": "^2",
|
"@tauri-apps/plugin-sql": "^2",
|
||||||
|
"harper.js": "^1.2.0",
|
||||||
"lucide-svelte": "^0.468.0",
|
"lucide-svelte": "^0.468.0",
|
||||||
"marked": "^17.0.1"
|
"marked": "^17.0.1"
|
||||||
},
|
},
|
||||||
|
|
@ -1785,6 +1786,12 @@
|
||||||
"node": ">=10.13.0"
|
"node": ">=10.13.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/harper.js": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/harper.js/-/harper.js-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-yer9QibW0pKdQdUaV1FO9KNGmuqrj943nx+gTx2/RfSns1wrAeumuSeOBnIWBDkBCXKLvgcG68poHF90W+T21Q==",
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
},
|
||||||
"node_modules/hasown": {
|
"node_modules/hasown": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
"@tauri-apps/plugin-fs": "^2",
|
"@tauri-apps/plugin-fs": "^2",
|
||||||
"@tauri-apps/plugin-opener": "^2",
|
"@tauri-apps/plugin-opener": "^2",
|
||||||
"@tauri-apps/plugin-sql": "^2",
|
"@tauri-apps/plugin-sql": "^2",
|
||||||
|
"harper.js": "^1.2.0",
|
||||||
"lucide-svelte": "^0.468.0",
|
"lucide-svelte": "^0.468.0",
|
||||||
"marked": "^17.0.1"
|
"marked": "^17.0.1"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
import { Send, Wand2, MessageSquare, Brain, Sparkles, Feather, RefreshCw, X, PenLine } from 'lucide-svelte';
|
import { Send, Wand2, MessageSquare, Brain, Sparkles, Feather, RefreshCw, X, PenLine } from 'lucide-svelte';
|
||||||
import type { Chapter } from '$lib/types';
|
import type { Chapter } from '$lib/types';
|
||||||
import Suggestions from './Suggestions.svelte';
|
import Suggestions from './Suggestions.svelte';
|
||||||
|
import GrammarCheck from './GrammarCheck.svelte';
|
||||||
import {
|
import {
|
||||||
emitUserInput,
|
emitUserInput,
|
||||||
emitNarrativeResponse,
|
emitNarrativeResponse,
|
||||||
|
|
@ -851,6 +852,9 @@
|
||||||
onRefresh={refreshSuggestions}
|
onRefresh={refreshSuggestions}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- Grammar Check -->
|
||||||
|
<GrammarCheck text={inputValue} onApplySuggestion={(newText) => inputValue = newText} />
|
||||||
|
|
||||||
<!-- Creative Writing Mode: Direction Input -->
|
<!-- Creative Writing Mode: Direction Input -->
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<div class="relative flex-1">
|
<div class="relative flex-1">
|
||||||
|
|
@ -922,6 +926,9 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Grammar Check -->
|
||||||
|
<GrammarCheck text={inputValue} onApplySuggestion={(newText) => inputValue = newText} />
|
||||||
|
|
||||||
<!-- Adventure Mode: Input area -->
|
<!-- Adventure Mode: Input area -->
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<div class="relative flex-1">
|
<div class="relative flex-1">
|
||||||
|
|
|
||||||
144
src/lib/components/story/GrammarCheck.svelte
Normal file
144
src/lib/components/story/GrammarCheck.svelte
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import { grammarService, type GrammarIssue } from '$lib/services/grammar';
|
||||||
|
import { AlertCircle, Check, X, Plus } from 'lucide-svelte';
|
||||||
|
import { slide } from 'svelte/transition';
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
text: string;
|
||||||
|
onApplySuggestion: (newText: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
let { text, onApplySuggestion }: Props = $props();
|
||||||
|
|
||||||
|
let issues = $state<GrammarIssue[]>([]);
|
||||||
|
let checking = $state(false);
|
||||||
|
let expandedIssue = $state<number | null>(null);
|
||||||
|
let debounceTimeout: ReturnType<typeof setTimeout> | null = null;
|
||||||
|
|
||||||
|
// Debounced lint check
|
||||||
|
$effect(() => {
|
||||||
|
if (debounceTimeout) {
|
||||||
|
clearTimeout(debounceTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!text.trim()) {
|
||||||
|
issues = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
debounceTimeout = setTimeout(async () => {
|
||||||
|
checking = true;
|
||||||
|
try {
|
||||||
|
issues = await grammarService.lint(text);
|
||||||
|
} finally {
|
||||||
|
checking = false;
|
||||||
|
}
|
||||||
|
}, 500);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if (debounceTimeout) {
|
||||||
|
clearTimeout(debounceTimeout);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleApplySuggestion(issue: GrammarIssue, suggestionIndex: number) {
|
||||||
|
const suggestion = issue.suggestions[suggestionIndex];
|
||||||
|
if (suggestion === undefined) return;
|
||||||
|
|
||||||
|
const before = text.slice(0, issue.start);
|
||||||
|
const after = text.slice(issue.end);
|
||||||
|
const newText = before + suggestion + after;
|
||||||
|
onApplySuggestion(newText);
|
||||||
|
expandedIssue = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleAddToDictionary(issue: GrammarIssue) {
|
||||||
|
await grammarService.addWord(issue.problemText);
|
||||||
|
// Re-lint to remove the issue
|
||||||
|
issues = await grammarService.lint(text);
|
||||||
|
expandedIssue = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDismiss(index: number) {
|
||||||
|
issues = issues.filter((_, i) => i !== index);
|
||||||
|
expandedIssue = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleIssue(index: number) {
|
||||||
|
expandedIssue = expandedIssue === index ? null : index;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if issues.length > 0}
|
||||||
|
<div class="space-y-1.5" transition:slide={{ duration: 150 }}>
|
||||||
|
{#each issues as issue, index (issue.start + '-' + issue.end)}
|
||||||
|
<div
|
||||||
|
class="rounded-lg bg-yellow-900/20 border border-yellow-700/40 overflow-hidden"
|
||||||
|
transition:slide={{ duration: 150 }}
|
||||||
|
>
|
||||||
|
<!-- Issue header -->
|
||||||
|
<div
|
||||||
|
class="w-full flex items-start gap-2 p-2 text-left hover:bg-yellow-900/10 transition-colors cursor-pointer"
|
||||||
|
onclick={() => toggleIssue(index)}
|
||||||
|
onkeydown={(e) => e.key === 'Enter' && toggleIssue(index)}
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<AlertCircle class="h-4 w-4 text-yellow-500 shrink-0 mt-0.5" />
|
||||||
|
<div class="flex-1 min-w-0">
|
||||||
|
<div class="flex items-center gap-2 flex-wrap">
|
||||||
|
<span class="text-xs font-medium text-yellow-400 bg-yellow-900/40 px-1.5 py-0.5 rounded">
|
||||||
|
{issue.kind}
|
||||||
|
</span>
|
||||||
|
<span class="text-xs text-yellow-300/80 truncate">
|
||||||
|
"{issue.problemText}"
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p class="text-xs text-yellow-200/70 mt-0.5 line-clamp-1">
|
||||||
|
{issue.message}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
class="p-1 rounded hover:bg-yellow-800/30 text-yellow-500/60 hover:text-yellow-400 shrink-0"
|
||||||
|
onclick={(e) => { e.stopPropagation(); handleDismiss(index); }}
|
||||||
|
title="Dismiss"
|
||||||
|
>
|
||||||
|
<X class="h-3.5 w-3.5" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Expanded content with suggestions -->
|
||||||
|
{#if expandedIssue === index}
|
||||||
|
<div class="px-2 pb-2 pt-1 border-t border-yellow-700/30" transition:slide={{ duration: 150 }}>
|
||||||
|
{#if issue.suggestions.length > 0}
|
||||||
|
<div class="flex flex-wrap gap-1.5">
|
||||||
|
{#each issue.suggestions.slice(0, 5) as suggestion, suggestionIndex}
|
||||||
|
<button
|
||||||
|
class="flex items-center gap-1 px-2 py-1 text-xs rounded bg-green-900/30 border border-green-700/40 text-green-300 hover:bg-green-900/50 transition-colors"
|
||||||
|
onclick={() => handleApplySuggestion(issue, suggestionIndex)}
|
||||||
|
>
|
||||||
|
<Check class="h-3 w-3" />
|
||||||
|
{suggestion || '(remove)'}
|
||||||
|
</button>
|
||||||
|
{/each}
|
||||||
|
{#if issue.kind.toLowerCase().includes('spell')}
|
||||||
|
<button
|
||||||
|
class="flex items-center gap-1 px-2 py-1 text-xs rounded bg-surface-700 border border-surface-600 text-surface-300 hover:bg-surface-600 transition-colors"
|
||||||
|
onclick={() => handleAddToDictionary(issue)}
|
||||||
|
title="Add to dictionary"
|
||||||
|
>
|
||||||
|
<Plus class="h-3 w-3" />
|
||||||
|
Add to dictionary
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<p class="text-xs text-yellow-400/60 italic">No suggestions available</p>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
123
src/lib/services/grammar.ts
Normal file
123
src/lib/services/grammar.ts
Normal file
|
|
@ -0,0 +1,123 @@
|
||||||
|
import { LocalLinter, binary, type Lint, type Suggestion, type LintConfig } from 'harper.js';
|
||||||
|
|
||||||
|
const DEBUG = false;
|
||||||
|
|
||||||
|
function log(...args: unknown[]) {
|
||||||
|
if (DEBUG) {
|
||||||
|
console.log('[Grammar]', ...args);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GrammarIssue {
|
||||||
|
message: string;
|
||||||
|
problemText: string;
|
||||||
|
start: number;
|
||||||
|
end: number;
|
||||||
|
suggestions: string[];
|
||||||
|
kind: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
class GrammarService {
|
||||||
|
private linter: LocalLinter | null = null;
|
||||||
|
private setupPromise: Promise<void> | null = null;
|
||||||
|
private enabled = true;
|
||||||
|
|
||||||
|
async setup(): Promise<void> {
|
||||||
|
if (this.linter) return;
|
||||||
|
if (this.setupPromise) return this.setupPromise;
|
||||||
|
|
||||||
|
this.setupPromise = (async () => {
|
||||||
|
try {
|
||||||
|
log('Initializing Harper linter...');
|
||||||
|
this.linter = new LocalLinter({ binary });
|
||||||
|
await this.linter.setup();
|
||||||
|
|
||||||
|
// Configure linter - disable some rules that might be too strict for creative writing
|
||||||
|
const config = await this.linter.getLintConfig();
|
||||||
|
// Disable rules that might interfere with creative writing
|
||||||
|
const updatedConfig: LintConfig = {
|
||||||
|
...config,
|
||||||
|
// Keep most rules enabled, but disable some that might be annoying
|
||||||
|
'SentenceCapitalization': false, // Creative writing might have stylistic lowercase
|
||||||
|
'LongSentences': false, // Creative writing often has long sentences
|
||||||
|
};
|
||||||
|
await this.linter.setLintConfig(updatedConfig);
|
||||||
|
|
||||||
|
log('Harper linter initialized successfully');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('[Grammar] Failed to initialize Harper:', error);
|
||||||
|
this.linter = null;
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
return this.setupPromise;
|
||||||
|
}
|
||||||
|
|
||||||
|
async lint(text: string): Promise<GrammarIssue[]> {
|
||||||
|
if (!this.enabled || !text.trim()) return [];
|
||||||
|
|
||||||
|
await this.setup();
|
||||||
|
if (!this.linter) return [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
const lints = await this.linter.lint(text, { language: 'plaintext' });
|
||||||
|
log('Linted text, found', lints.length, 'issues');
|
||||||
|
|
||||||
|
return lints.map((lint: Lint) => {
|
||||||
|
const span = lint.span();
|
||||||
|
const suggestions = lint.suggestions();
|
||||||
|
|
||||||
|
return {
|
||||||
|
message: lint.message(),
|
||||||
|
problemText: lint.get_problem_text(),
|
||||||
|
start: span.start,
|
||||||
|
end: span.end,
|
||||||
|
suggestions: suggestions.map((s: Suggestion) => s.get_replacement_text()),
|
||||||
|
kind: lint.lint_kind_pretty(),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
log('Linting failed:', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async applySuggestion(text: string, issue: GrammarIssue, suggestionIndex: number): Promise<string> {
|
||||||
|
if (!this.linter) return text;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Reconstruct by replacing the span with the suggestion text
|
||||||
|
const suggestion = issue.suggestions[suggestionIndex];
|
||||||
|
if (suggestion === undefined) return text;
|
||||||
|
|
||||||
|
const before = text.slice(0, issue.start);
|
||||||
|
const after = text.slice(issue.end);
|
||||||
|
return before + suggestion + after;
|
||||||
|
} catch (error) {
|
||||||
|
log('Failed to apply suggestion:', error);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setEnabled(enabled: boolean) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
isEnabled(): boolean {
|
||||||
|
return this.enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
async addWord(word: string): Promise<void> {
|
||||||
|
await this.setup();
|
||||||
|
if (!this.linter) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.linter.importWords([word]);
|
||||||
|
log('Added word to dictionary:', word);
|
||||||
|
} catch (error) {
|
||||||
|
log('Failed to add word:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const grammarService = new GrammarService();
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { database } from '$lib/services/database';
|
import { database } from '$lib/services/database';
|
||||||
import { settings } from '$lib/stores/settings.svelte';
|
import { settings } from '$lib/stores/settings.svelte';
|
||||||
|
import { grammarService } from '$lib/services/grammar';
|
||||||
import AppShell from '$lib/components/layout/AppShell.svelte';
|
import AppShell from '$lib/components/layout/AppShell.svelte';
|
||||||
|
|
||||||
let initialized = $state(false);
|
let initialized = $state(false);
|
||||||
|
|
@ -15,6 +16,9 @@
|
||||||
// Initialize settings from database
|
// Initialize settings from database
|
||||||
await settings.init();
|
await settings.init();
|
||||||
|
|
||||||
|
// Pre-load grammar checker WASM in background (don't await)
|
||||||
|
grammarService.setup().catch(console.error);
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Initialization error:', e);
|
console.error('Initialization error:', e);
|
||||||
|
|
|
||||||
201
third-party-licenses/harper_LICENSE.md
Normal file
201
third-party-licenses/harper_LICENSE.md
Normal file
|
|
@ -0,0 +1,201 @@
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright 2024 Elijah Potter
|
||||||
|
|
||||||
|
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.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue