From 71885b8a79fc3662ebebb80ec3107f05fb329b22 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Thu, 8 Jan 2015 13:00:29 +0100 Subject: [PATCH 1/2] Add missing ^ in Frege heuristic regexp. --- lib/linguist/heuristics.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 97c1015a..5e603f23 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -175,7 +175,7 @@ module Linguist disambiguate "Frege", "Forth", "Text" do |data| if /^(: |also |new-device|previous )/.match(data) Language["Forth"] - elsif /\s*(import|module|package|data|type) /.match(data) + elsif /^\s*(import|module|package|data|type) /.match(data) Language["Frege"] else Language["Text"] From 3957a11f25d2ea0ea84554a2d3651e1941e6ad18 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Thu, 8 Jan 2015 19:35:02 +0100 Subject: [PATCH 2/2] Add to sample to show that a false positive goes away. --- samples/Text/messages.fr | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/Text/messages.fr b/samples/Text/messages.fr index da0269bb..c8108873 100644 --- a/samples/Text/messages.fr +++ b/samples/Text/messages.fr @@ -1 +1,2 @@ the green potato=la pomme de terre verte +le nouveau type de musique=the new type of music