Package net.sf.okapi.steps.diffleverage
Class FileAligner<T>
- java.lang.Object
-
- net.sf.okapi.steps.diffleverage.FileAligner<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
Iterable<FileAlignment<T>>
public class FileAligner<T> extends Object implements Iterable<FileAlignment<T>>
Match up (align) files based on full path name. There is a bi-lingual case (source matched with target files) and tri-lingual (new source matched with old source, matched with old target).- Author:
- HARGRAVEJE
-
-
Constructor Summary
Constructors Constructor Description FileAligner(boolean lowerCase, List<FileLikeThing<T>> srcFiles, List<FileLikeThing<T>> trgFiles, URI srcRootUri, URI trgRootUri)Bi-lingual alignment (match source with target files)FileAligner(boolean lowerCase, List<FileLikeThing<T>> newFiles, List<FileLikeThing<T>> oldSrcFiles, List<FileLikeThing<T>> oldTrgFiles, URI newRootUri, URI oldSrcRootUri, URI oldTrgRootUri)Tri-lingual alignment (new source matched with old source, matched with old target).FileAligner(List<FileLikeThing<T>> srcFiles, List<FileLikeThing<T>> trgFiles, URI srcRootUri, URI trgRootUri)Bi-lingual alignment (match source with target files).FileAligner(List<FileLikeThing<T>> newFiles, List<FileLikeThing<T>> oldSrcFiles, List<FileLikeThing<T>> oldTrgFiles, URI newRootUri, URI oldSrcRootUri, URI oldTrgRootUri)Tri-lingual alignment (new source matched with old source, matched with old target).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidalign()match up (align) new files (i.e., source our new source) withList<FileAlignment<T>>getAlignments()GetListofFileLikeThingsIterator<FileAlignment<T>>iterator()Iterator over alignedFileLikeThings-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
FileAligner
public FileAligner(List<FileLikeThing<T>> newFiles, List<FileLikeThing<T>> oldSrcFiles, List<FileLikeThing<T>> oldTrgFiles, URI newRootUri, URI oldSrcRootUri, URI oldTrgRootUri)
Tri-lingual alignment (new source matched with old source, matched with old target). This method will lower case the file paths by default.- Parameters:
newFiles- - new source filesoldSrcFiles- - old source files (i.e, from previous translation)oldTrgFiles- - old target files that match the old source files.newRootUri- - root directory of the new source files.oldSrcRootUri- - root directory of the old source files.oldTrgRootUri- - root directory of the new target files.
-
FileAligner
public FileAligner(boolean lowerCase, List<FileLikeThing<T>> newFiles, List<FileLikeThing<T>> oldSrcFiles, List<FileLikeThing<T>> oldTrgFiles, URI newRootUri, URI oldSrcRootUri, URI oldTrgRootUri)Tri-lingual alignment (new source matched with old source, matched with old target).- Parameters:
lowerCase- - true to lower case file paths before matching, false to leave as-isnewFiles- - new source filesoldSrcFiles- - old source files (i.e, from previous translation)oldTrgFiles- - old target files that match the old source files.newRootUri- - root directory of the new source files.oldSrcRootUri- - root directory of the old source files.oldTrgRootUri- - root directory of the new target files.
-
FileAligner
public FileAligner(List<FileLikeThing<T>> srcFiles, List<FileLikeThing<T>> trgFiles, URI srcRootUri, URI trgRootUri)
Bi-lingual alignment (match source with target files). This method will lower case the file paths by default.- Parameters:
srcFiles- - source filestrgFiles- - target filessrcRootUri- - source root directorytrgRootUri- - target root directory
-
FileAligner
public FileAligner(boolean lowerCase, List<FileLikeThing<T>> srcFiles, List<FileLikeThing<T>> trgFiles, URI srcRootUri, URI trgRootUri)Bi-lingual alignment (match source with target files)- Parameters:
lowerCase- - true to lower case file paths before matching, false to leave as-is.srcFiles- - source filestrgFiles- - target filessrcRootUri- - source root directorytrgRootUri- - target root directory
-
-
Method Detail
-
align
public void align()
match up (align) new files (i.e., source our new source) with
-
iterator
public Iterator<FileAlignment<T>> iterator()
Iterator over alignedFileLikeThings
-
getAlignments
public List<FileAlignment<T>> getAlignments()
GetListofFileLikeThings- Returns:
FileAlignmentas a list
-
-