mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Add 'text' language with samples, and heuristics for .fr.
This commit is contained in:
@@ -156,5 +156,14 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "Frege", "Forth", "text" do |data|
|
||||
if /^(: |also |new-device|previous )/.match(data)
|
||||
Language["Forth"]
|
||||
elsif /\s*(import|module|package|data|type) /.match(data)
|
||||
Language["Frege"]
|
||||
else
|
||||
Language["text"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3232,6 +3232,15 @@ reStructuredText:
|
||||
- .rest
|
||||
ace_mode: none
|
||||
|
||||
text:
|
||||
type: prose
|
||||
wrap: true
|
||||
extensions:
|
||||
- .txt
|
||||
- .fr
|
||||
tm_scope: none
|
||||
ace_mode: none
|
||||
|
||||
wisp:
|
||||
type: programming
|
||||
ace_mode: clojure
|
||||
|
||||
12
samples/CMake/filenames/CMakeLists.txt
Normal file
12
samples/CMake/filenames/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
project(Foo)
|
||||
|
||||
set(CMAKE_SKIP_RPATH TRUE)
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/local")
|
||||
|
||||
add_subdirectory(bar)
|
||||
|
||||
add_executable(foo foo.c)
|
||||
target_link_libraries(foo pthread)
|
||||
install(TARGETS foo DESTINATION bin)
|
||||
1
samples/text/messages.fr
Normal file
1
samples/text/messages.fr
Normal file
@@ -0,0 +1 @@
|
||||
the green potato=la pomme de terre verte
|
||||
1
samples/text/readme.txt
Normal file
1
samples/text/readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
Read me now!
|
||||
@@ -118,6 +118,14 @@ class TestHeuristcs < Test::Unit::TestCase
|
||||
})
|
||||
end
|
||||
|
||||
def test_fr_by_heuristics
|
||||
assert_heuristics({
|
||||
"Frege" => all_fixtures("Frege"),
|
||||
"Forth" => all_fixtures("Forth"),
|
||||
"text" => all_fixtures("text")
|
||||
})
|
||||
end
|
||||
|
||||
def assert_heuristics(hash)
|
||||
candidates = hash.keys.map { |l| Language[l] }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user