<commit_before>var word = ""
$(document).keypress(function(e) {
    if(e.which == 13) {
      word = $('#givenWord').val();
      word = word.toLowerCase()
      console.log(word)
      var ans = new Array;
      $.get('preceed_with_an.txt', function(data){
        var ans = data.split('\n');
        var answer = $("#answer");
        for (var i = 0; i < ans.length; i++){
          if (ans[i] === word){
            $(answer).text("An");
            break;
          }else{
            $(answer).text("A");
          }
        }
      });
    }
});
<commit_msg>now works with spaces and two words.<commit_after>var word = ""
var arr = []
$(document).keypress(function(e) {
    if(e.which == 13) {
      
      word = $('#givenWord').val();
      word = word.toLowerCase();
      word = $.trim(word);
      console.log(word.split(" "));
      word = word.split(" ")[0];
      console.log(word);

      var ans = new Array;
      $.get('preceed_with_an.txt', function(data){
        var ans = data.split('\n');
        var answer = $("#answer");
        for (var i = 0; i < ans.length; i++){
          if (ans[i] === word){
            $(answer).text("An");
            break;
          }else{
            $(answer).text("A");
          }
        }
      });
    }
});

{'fraction_non_alphanumeric': 0.2031496062992126, 'fraction_numerical': 0.005511811023622047, 'mean_word_length': 1.721627408993576, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '444712', 'n_tokens_mistral': 408, 'n_tokens_neox': 404, 'n_words': 86}