anchor.diff:  %% 
   -module(refac_sim_expr_search).
   
  --export([sim_expr_search/4, normalise_record_expr/4]).
  -
  --compile(export_all).
  +-export([sim_expr_search/5, normalise_record_expr/4]).
   
   -include("../include/wrangler.hrl").
  +
  +-define(SimiScore, 0.2).
   %% ================================================================================================
   %% @doc Search a user-selected expression or a sequence of expressions from an Erlang source file.
   %%
  
positive.code: 			    NormalisedFields =lists:map(Fun, Fields2),
  			    refac_syntax:record_expr(Arg, Type, NormalisedFields);
  			_ -> 
  			    ?wrangler_io("Warning: wrangler could not find the definition of record '~p'.",[Type1]),
  			    Node
  		    end;
  		_ -> Node
  
negative.code: 	    end;
  	_ -> {[], false}
      end.
  
  
  get_module_record_info(FName, SearchPaths, TabWidth) ->
      Dir = filename:dirname(FName),
      DefaultIncl1 = [".","..", "../hrl", "../incl", "../inc", "../include"],
      DefaultIncl2 = [filename:join(Dir, X) || X <-DefaultIncl1],
      Includes = SearchPaths++DefaultIncl2,
      case refac_epp:parse_file(FName, Includes,[], TabWidth, refac_util:file_format(FName)) of 
  	{ok, Forms, _} -> Forms1 =  lists:filter(fun(F) ->
  							case F of 
  							    {attribute, _, file, _} -> false;
  							    {attribute, _, type, {{record, _}, _, _}} -> false;
  							    _ -> true
  							end
  						 end, Forms),
  			  SyntaxTree = refac_recomment:recomment_forms(Forms1,[]),
  			  Info = refac_syntax_lib:analyze_forms(SyntaxTree),
  			  case lists:keysearch(records,1, Info) of 
  			      {value, {records, Records}} -> Records;
  			      _ ->[]
  			  end;
  	{error, _Reason} -> []
     end.
  
  
  no_of_nodes(Nodes) when is_list(Nodes) ->
      lists:sum(lists:map(fun(N) -> no_of_nodes(N) end, Nodes));
  no_of_nodes(Node) ->
      case refac_syntax:is_leaf(Node) of
  	true ->
  	     1;
  	_ ->
  	    SubTrees = refac_syntax:subtrees(Node),
  	    lists:sum(lists:map(fun(T) -> no_of_nodes(T) end, SubTrees))
      end.
  	     
  