Skip to content

Commit c0b18f3

Browse files
Release 1.1.2 cleanup
1 parent d1ea042 commit c0b18f3

File tree

10 files changed

+5
-391
lines changed

10 files changed

+5
-391
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "ical-obsidian-sync",
33
"name": "iCalSync",
4-
"version": "1.1.1",
4+
"version": "1.1.2",
55
"minAppVersion": "0.15.0",
66
"description": "Synchronize iCalendar with your notes",
77
"author": "Vaccarini Lorenzo",

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
22
"name": "obsidian-sample-plugin",
3-
"version": "1.1.0",
3+
"version": "1.1.2",
44
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
55
"main": "main.js",
66
"scripts": {
77
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs",
8-
"version": "node version-bump.mjs && git add manifest.json versions.json",
9-
"pack": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs && cp main.js ical-obsidian-sync && cp manifest.json ical-obsidian-sync && cp styles.css ical-obsidian-sync && cp .noun_patterns.txt ical-obsidian-sync && cp .proper_name_patterns.txt ical-obsidian-sync",
10-
"dev": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production && cp main.js /Users/lorenzovaccarini/Library/Mobile\\ Documents/iCloud~md~obsidian/Documents/Obsidian\\ Vault/.obsidian/plugins/ical-obsidian-sync && cp .noun_patterns.txt /Users/lorenzovaccarini/Library/Mobile\\ Documents/iCloud~md~obsidian/Documents/Obsidian\\ Vault/.obsidian/plugins/ical-obsidian-sync && cp .proper_name_patterns.txt /Users/lorenzovaccarini/Library/Mobile\\ Documents/iCloud~md~obsidian/Documents/Obsidian\\ Vault/.obsidian/plugins/ical-obsidian-sync && cp styles.css /Users/lorenzovaccarini/Library/Mobile\\ Documents/iCloud~md~obsidian/Documents/Obsidian\\ Vault/.obsidian/plugins/ical-obsidian-sync"
8+
"version": "node version-bump.mjs && git add manifest.json versions.json"
119
},
1210
"keywords": [],
1311
"author": "",

src/controllers/cacheController.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/controllers/calendarViewController.ts

Lines changed: 0 additions & 181 deletions
This file was deleted.

src/controllers/eventController.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {Sentence} from "../model/sentence";
55
import iCloudController from "./iCloudController";
66
import {Notice, requestUrl, RequestUrlParam} from "obsidian";
77
import {appendFileSync, readFileSync, writeFileSync} from "fs";
8-
import cacheController from "./cacheController";
98
import {DateRange} from "../model/dateRange";
109

1110
class EventController{
@@ -162,18 +161,6 @@ class EventController{
162161
}
163162
}
164163

165-
async getEventsFromRange(dateRange: DateRange): Promise<iCloudCalendarEvent[]> {
166-
const cacheCheck = cacheController.checkCache(dateRange);
167-
if (cacheCheck.missedDateRanges.length == 0) return cacheCheck.cachedICouldEvents;
168-
const iCloudEvents = cacheCheck.cachedICouldEvents;
169-
for (let i=0; i<cacheCheck.missedDateRanges.length; i++){
170-
const missedDateRange = cacheCheck.missedDateRanges[i];
171-
const fetchedICloudEvents = await iCloudController.getICloudEvents(missedDateRange);
172-
fetchedICloudEvents.forEach(iCloudEvent => iCloudEvents.push(iCloudEvent));
173-
}
174-
return iCloudEvents;
175-
}
176-
177164
// This method sends a body-less post request to an internal server to notify the synchronisation request
178165
// The purpose is to publish on the README page a badge with the number of synced requests
179166
private updateCounter() {

src/controllers/nlpController.ts

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,12 @@ class NlpController {
1919
private _secondaryNLP;
2020
private _ready: boolean;
2121

22-
private test_list_pos: string[];
23-
private nouns: string[];
24-
private test_list_entities: string[];
25-
private map: Map<string[], string>;
26-
2722
constructor() {
2823
this._ready = false;
2924
this._mainNLP = wink( model );
3025
this._secondaryNLP = wink (model);
3126
this._customPatterns = [];
3227
this._secondaryCustomPatterns = [];
33-
34-
this.test_list_pos = [];
35-
this.test_list_entities = [];
36-
this.map = new Map();
37-
this.nouns = [];
3828
}
3929

4030
injectPath(pluginPath: string){
@@ -66,7 +56,7 @@ class NlpController {
6656
{name: "ordinalDateReverse", patterns: [" [|DATE] [DATE|may|march] [|DET] [ORDINAL]"]},
6757
);
6858
this._customPatterns.push(
69-
{name: "timeRange", patterns: ["[|ADP] [TIME|CARDINAL|NUM] [|am|pm] [|ADP] [TIME|CARDINAL|NUM] [|am|pm]", "[TIME|CARDINAL] [-|/] [TIME|CARDINAL]"]},
59+
{name: "timeRange", patterns: ["from [TIME|CARDINAL|NUM] [|am|pm] to [TIME|CARDINAL|NUM] [|am|pm]", "[TIME|CARDINAL] [-|/] [TIME|CARDINAL]"]},
7060
{name: "exactTime", patterns: ["[at|for] [CARDINAL|TIME]"]}
7161
)
7262
this._customPatterns.push({name: "intentionalVerb", patterns: ["[|AUX] [VERB] [|ADP] [|DET] [NOUN]"]});
@@ -421,55 +411,6 @@ class NlpController {
421411
return eventTitle;
422412
}
423413

424-
test(sentence: Sentence) {
425-
const text = sentence.value;
426-
const sentences = text.split("\n");
427-
sentences.forEach(sentence => {
428-
const caseInsensitiveText = sentence.toLowerCase();
429-
const doc = this._mainNLP.readDoc(caseInsensitiveText);
430-
const testDoc = this._secondaryNLP.readDoc(caseInsensitiveText);
431-
const customEntities = doc.customEntities().out(this._mainNLP.its.detail);
432-
const secondaryCustomE = testDoc.customEntities().out(this._secondaryNLP.its.detail);
433-
console.log("customE", customEntities);
434-
console.log("secondaryCustomE", secondaryCustomE);
435-
const entities = doc.entities().out(this._mainNLP.its.detail);
436-
const dates = entities.filter(e => e.type == "DATE");
437-
const tokens = doc.tokens();
438-
const tokenValues = tokens.out();
439-
const pos = tokens.out(this._mainNLP.its.pos);
440-
console.log(pos);
441-
pos.forEach((p, i) => {
442-
if (p == "PROPN"){
443-
const corrispectiveToken = tokenValues[i];
444-
const corrispectiveDateList = dates.filter(d => d.value == corrispectiveToken)
445-
if (corrispectiveDateList.length > 0){
446-
pos[i] = corrispectiveDateList[0].type;
447-
}
448-
}
449-
if (p == "PUNCT"){
450-
pos.remove(p);
451-
}
452-
if (p == "NOUN"){
453-
const corrispectiveToken = tokenValues[i];
454-
this.nouns.push(corrispectiveToken);
455-
}
456-
})
457-
this.test_list_pos.push(pos);
458-
this.map.set(pos, sentence);
459-
})
460-
}
461-
462-
print() {
463-
console.log("POS list")
464-
console.log(this.test_list_pos);
465-
this.test_list_pos = [];
466-
console.log(Array.from(this.map.entries()));
467-
console.log("Nouns")
468-
console.log(this.nouns);
469-
this.nouns = [];
470-
471-
}
472-
473414
}
474415

475416
const nplController = new NlpController();

src/model/cacheCheck.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/model/calendarViewDetail.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)