Skip to content

Instantly share code, notes, and snippets.

View dexter-stpierre's full-sized avatar

Dexter St-Pierre dexter-stpierre

  • Q3 Contracting
  • Minneapolis, MN
View GitHub Profile
@dexter-stpierre
dexter-stpierre / README.md
Last active December 17, 2023 14:07
Readwise-Obsidian Workflow

Motivation

I decided to create this workflow based on my belief that if information is synced into my Obsidian vault then that data should be completely owned by the tool that synced it. It should never be edited within my vault, and it should be able to be deleted and resynced (hard resync) from that tool with little to no impact to my vault. If you don't agree with this mindset then no worries! This workflow can still help you keep track of which articles you have processed and which ones have new highlights to process. Even if you think this workflow isn't for you, you might learn something in this that might help you solve some problems in your own vault.

Since I only edit highlights and notes from Readwise in Readwise I had to have a way of knowing which highlights I have reviewed/processed and which highlights I still need to do that for. Since I wanted to be abnle to do a hard resync that had to live completely outside of the information that Readwise tracks in my vault. So I created a system in wh

# Answers
1. Create function called `getTokens`. This function takes an argument called `rawString` which is a string and returns array of all words in the string in alphabetical order
2. Comment
3. Sets the string to lowercase, splits it on characters that normally seperate words, filters out any falsy values, sorts the words alphabetically , and then returns that result
4. End of function
5. Whitespace
6. Create function called `mostFrequentWord`. This function takes an argument called `text` which is a string and returns a string of the most frequently used word in the string
7. Call the getTokens function and set the return value to a variable called `words`
8. set a variable called `wordFrequencies` fo an empty object. This object will hold key-value pairs indicating how often a word occurs in `text`