# fix typos

# idea from dk:
# string distance calculation that weights letters that are close in qwerty-space

# library(tidyverse)
# library(stringdist)
# data("clean_caterpillars")
# data("messy_caterpillars")
# load("~/Desktop/messy.cats/data/clean_names.rda")
# load("~/Desktop/messy.cats/data/messy_names.rda")
#
# # testing dataset ----
# rep(clean_caterpillars$species,clean_caterpillars$count) -> clean_caterpillars_rep
#
# append(clean_caterpillars_rep,messy_caterpillars$CaterpillarSpecies) -> typo_caterpillars
#
# typo_df <- as.data.frame(typo_caterpillars)
# OSA / DL
  # use DL, probably give option for OSA

# Number of Edits
  # guess n check
  # find the most fucked up typo and count number of edits
  # keep it simple to start
  # have threshold be percentage of the word
    # change >= ~90% of letters, probably not a typo

# As prominence / how much more common the correctly spelled word is versus wrong word
  # as either number or percent
  # enter as integer for number and string for percent

# applications
  # names / words not in US dictionary
  # if using basic EN words just use hunspell (https://www.rdocumentation.org/packages/hunspell/versions/3.0.2/topics/hunspell)
# add handling for multiple typo matches
# add to vignette

# add better error handling to all packages
