Class: Treat::Loaders::Stanford

Inherits:
BindIt
  • Object
show all
Defined in:
lib/treat/loaders/stanford.rb

Overview

A helper class to load the CoreNLP package.

Class Method Summary collapse

Class Method Details

.find_model(name, language) ⇒ Object


11
12
13
14
15
16
17
18
# File 'lib/treat/loaders/stanford.rb', line 11

def self.find_model(name, language)
  language = language.intern
  model_file = StanfordCoreNLP::Config::Models[name][language]
  model_dir  = StanfordCoreNLP::Config::ModelFolders[name]
  model_path = Treat.libraries.stanford.model_path ||
  File.join(Treat.paths.models, 'stanford')
  File.join(model_path, model_dir, model_file)
end

.load(language = nil) ⇒ Object


6
7
8
9
# File 'lib/treat/loaders/stanford.rb', line 6

def self.load(language = nil)
  require 'stanford-core-nlp'
  super(StanfordCoreNLP, :stanford, language)
end