Sha256: 61d13601bb3631b7a56f15f3dd8729c4686018a146236fc948d8209346f11560

Contents?: true

Size: 1.81 KB

Versions: 2

Compression:

Stored size: 1.81 KB

Contents

# encoding: utf-8
require 'spec_helper'
describe Fonemas do
  it 'test acentos' do
    Fonemas.fonemas('hasta').should include("aa s t a")
    Fonemas.fonemas('torta').should include("t oo r t a")
    Fonemas.fonemas('ungüento').should include("u n g u ee n t o")
    Fonemas.fonemas('abuela').should include('a g u ee l a')
    Fonemas.fonemas('aro').should include('aa r o')
    Fonemas.fonemas('bondad').should include('b o n D aa d')
    Fonemas.fonemas('gestión').should include('j e s t i oo n')
    Fonemas.fonemas('abstraer').should include('a B s t r a ee r')
    Fonemas.fonemas('presidida').should include('p r e s i ii d a')
    Fonemas.fonemas('guerra').should include('gu ee R a')
    Fonemas.fonemas('buitre').should include('g u ii t r e')
    Fonemas.fonemas('huaso').should include('g u aa s o')
    Fonemas.fonemas('huevo').should include('g u ee b o')
    Fonemas.fonemas('huevo').should include('g u ee o')
    Fonemas.fonemas('huifa').should include('g u ii f a')
    Fonemas.fonemas('diente').should include('d i ee n t e')
    Fonemas.fonemas('diente').should include('D i ee n t e')
    Fonemas.fonemas('bueno').should include('b u ee n o')
    Fonemas.fonemas('bueno').should include('B u ee n o')
    Fonemas.fonemas('obvio').should include('oo B b i o')
    Fonemas.fonemas('obvio').should include('oo b i o')
    Fonemas.fonemas('guerra').should_not include('ee R a')






    for i in Fonemas.fonemas('adskribir')
      i.should end_with('ii r')
    end
  end

  it 'test diptongos' do
    Fonemas.isDiptongo("buitre",1,2).should be(true)
  end

  it 'combinar fonemas' do
    test = ['a',['b','c'],['d','e']]
    output = Fonemas.normalize(Fonemas.generateFonemas(test))
    output.should include('a b d')
    output.should include('a b e')
    output.should include('a c d')
    output.should include('a c e')


  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fonemas-0.1.3 spec/fonemas/fonema_spec.rb
fonemas-0.1.2 spec/fonemas/fonema_spec.rb