/**
 * 
 * Copyright 1999-2012 Carnegie Mellon University.  
 * Portions Copyright 2002 Sun Microsystems, Inc.  
 * Portions Copyright 2002 Mitsubishi Electric Research Laboratories.
 * All Rights Reserved.  Use is subject to license terms.
 * 
 * See the file "license.terms" for information on usage and
 * redistribution of this file, and for a DISCLAIMER OF ALL 
 * WARRANTIES.
 *
 */

package edu.cmu.sphinx.fst;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import org.testng.annotations.Test;

import edu.cmu.sphinx.fst.Fst;
import edu.cmu.sphinx.fst.operations.Compose;
import edu.cmu.sphinx.fst.semiring.TropicalSemiring;

/**
 * @author John Salatas <jsalatas@users.sourceforge.net>
 * 
 */
public class ComposeEpsilonTest  {
    
    @Test
    public void testCompose() {
        Fst fstA = Convert.importFst("src/test/edu/cmu/sphinx/fst/data/tests/algorithms/composeeps/A",
                new TropicalSemiring());
        Fst fstB = Convert.importFst("src/test/edu/cmu/sphinx/fst/data/tests/algorithms/composeeps/B",
                new TropicalSemiring());
        Fst fstC = Convert.importFst(
                "src/test/edu/cmu/sphinx/fst/data/tests/algorithms/composeeps/fstcomposeeps",
                new TropicalSemiring());

        Fst fstComposed = Compose.get(fstA, fstB, new TropicalSemiring());
        assertThat(fstC, equalTo(fstComposed));
    }

}

@@ -51,21 +51,16 @@
 versity.
-  %0A *
  Portion
@@ -79,16 +79,19 @@
 2002 Sun
+%0A *
  Microsy
@@ -105,13 +105,8 @@
 Inc.
-  %0A *
  Por
@@ -154,16 +154,19 @@
 Research
+%0A *
  Laborat
@@ -171,19 +171,16 @@
 atories.
-%0A *
  All Rig
@@ -192,17 +192,16 @@
 eserved.
- 
  Use is 
@@ -290,19 +290,16 @@
 sage and
-%0A *
  redistr
@@ -308,16 +308,19 @@
 ution of
+%0A *
  this fi
@@ -351,20 +351,16 @@
  OF ALL 
-%0A * 
 WARRANTI
@@ -365,16 +365,17 @@
 TIES.%0A *
+ 
 %0A */%0A%0Apa
@@ -419,206 +419,339 @@
 tic 
-org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.equalTo;%0A%0Aimport org.testng.annotations.Test;%0A%0Aimport edu.cmu.sphinx.fst.Fst;%0Aimport edu.cmu.sphinx.fst.operations.Compose;
+com.google.common.io.Resources.getResource;%0Aimport static edu.cmu.sphinx.fst.Convert.importFst;%0Aimport static edu.cmu.sphinx.fst.operations.Compose.get;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.equalTo;%0A%0Aimport java.io.File;%0Aimport java.net.URL;%0A%0Aimport org.testng.annotations.Test;%0A
 %0Aimp
@@ -801,16 +801,17 @@
 iring;%0A%0A
+%0A
 /**%0A * @
@@ -903,23 +903,18 @@
 lonTest 
- 
 %7B%0A
-    
 %0A    @Te
@@ -960,435 +960,459 @@
     
-Fst fstA = Convert.importFst(%22src/test/edu/cmu/sphinx/fst/data/tests/algorithms/composeeps/A%22,%0A                new TropicalSemiring());%0A        Fst fstB = Convert.importFst(%22src/test/edu/cmu/sphinx/fst/data/tests/algorithms/composeeps/B%22,%0A                new TropicalSemiring());%0A        Fst fstC = Convert.importFst(%0A                %22src/test/edu/cmu/sphinx/fst/data/tests/algorithms/composeeps/fstcomposeeps%22,%0A               
+URL url = getResource(getClass(), %22algorithms/composeeps/A.fst.txt%22);%0A        File parent = new File(url.getPath()).getParentFile();%0A%0A        String path = new File(parent, %22A%22).getPath();%0A        Fst fstA = importFst(path, new TropicalSemiring());%0A        path = new File(parent, %22B%22).getPath();%0A        Fst fstB = importFst(path, new TropicalSemiring());%0A        path = new File(parent, %22fstcomposeeps%22).getPath();%0A        Fst fstC = importFst(path,
  new
@@ -1460,24 +1460,16 @@
 posed = 
-Compose.
 get(fstA

Fix resource paths.