⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (378 Bytes)
Bug #6209
» test-case.rb
The test case source -
octplane (Pierre B)
, 03/28/2012 01:04 AM
require
'rubygems'
require
'classifier'
classifier
=
if
File
.
exists?
(
'classifier.data'
)
File
.
open
(
'classifier.data'
)
do
|
file
|
Marshal
.
load
(
file
)
end
else
Classifier
::
Bayes
.
new
"ruby"
end
path_or_file
=
"test-file.rb"
lang
=
"ruby"
classifier
.
train
(
"ruby"
,
File
.
open
(
path_or_file
).
read
)
File
.
open
(
'classifier.data'
,
'w'
)
do
|
file
|
Marshal
.
dump
(
classifier
,
file
)
end
« Previous
1
2
3
Next »
(1-1/3)
Loading...