Sha256: a708a44c95afdcb3c23f5c0b7ebc7f284fc12fa7e28daba649cf01e142baacff

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

# encoding: utf-8
require 'jldrill/spec/StoryMemento'
require 'jldrill/model/items/JEDictionary'

module JLDrill::LoadEdictInEUC

    Story = JLDrill::StoryMemento.new("Can Load Edict in EUC")
    def Story.setup(type)
        super(type)
#        @context = @mainContext.editVocabularyContext
#        @view = @context.peekAtView
    end

###########################################

    describe Story.stepName("Edict can parse EUC entries") do

        it "should convert EUC data to UTF8" do
            euc = JLDrill::JEDictionary.new
            euc.createLines("\261\253 [\244\242\244\341] /(n) rain/(P)/")
            euc.encoding.should eql(Kconv::EUC)
            euc.parseLine(0).should_not be_nil
            euc.vocab(0).kanji.should eql("雨")
            euc.vocab(0).reading.should eql("あめ")
        end

        # If you don't specify EUC as the input encoding, NKF sometimes
        # picks the wrong one.  Here's an example.
        it "should be able to parse いってき" do
            euc = JLDrill::JEDictionary.new
            euc.createLines("\260\354\332\263 [\244\244\244\303\244\306\244\255] /(n,vs) casting off or away/")
            euc.encoding.should eql(Kconv::EUC)
            euc.parseLine(0).should_not be_nil
            euc.vocab(0).kanji.should eql("一擲")
            euc.vocab(0).reading.should eql("いってき")
        end
    end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jldrill-0.6.0.1 spec/jldrill/stories/LoadEdictInEUC_story.rb