anchor.diff:  -import(expander, [expand/1]).
   
   -export([correct/1, init/1, loop_correct/1]).
  +
  +-define(MIN_SIZE_TO_DOUBLE_EXPAND, 6).
   
   
   line_token_to_tuple([_|[H2|[H3|[]]]]) ->
  
positive.code:           X when X =/= -1  -> 
             Sender ! {found, Word},
              loop_correct(Dict);
            _ ->
              
          
            PossibleWords = expander:expand(Word, expand_once), % get all the possible variations from expander
            CorrectedWord = find_most_common(Dict,PossibleWords), % find most common word as a solution
  
            case ((length(CorrectedWord) == 0) and (length(Word) < 7)) of
              true ->
                PossibleWords2 = expander:expand(Word, expand_twice),
                CorrectedWord2 = find_most_common(Dict,PossibleWords2),
                Sender ! {found, CorrectedWord2};
              false ->
                Sender ! {found, CorrectedWord} 
              end,
            loop_correct(Dict)
          end
      end.
  
  init(DictionaryFile) ->
    Dict = maps:from_list(load_file(DictionaryFile)),
    Pid = spawn(?MODULE, loop_correct, [Dict]),
  
negative.code: 
  correct([]) -> [];
  
  %correct a word
  correct(Word) ->
    whereis(spelling_corrector_server) ! {correct, self(), Word},
    receive    
  