public class DataConvertor
extends java.lang.Object
UserId ItemId Rating
,
separted by " \t,"Constructor and Description |
---|
DataConvertor(java.lang.String sourcePath,
java.lang.String targetPath) |
Modifier and Type | Method and Description |
---|---|
void |
cvtFirstLines(java.lang.String sep1,
java.lang.String sep2)
Source File Format:
First Line: UserID Sep #Ratings Other Lines: ItemID Sep2 Rating |
void |
cvtSeparator(java.lang.String sep,
java.lang.String toSep)
Convert a data file separated by
sep to a data file separated by
toSep |
void |
setSourcePath(java.lang.String sourcePath) |
void |
setTargetPath(java.lang.String targetPath) |
public DataConvertor(java.lang.String sourcePath, java.lang.String targetPath) throws java.lang.Exception
sourcePath
- path to the source filetargetPath
- path to the target filejava.lang.Exception
public void cvtSeparator(java.lang.String sep, java.lang.String toSep) throws java.lang.Exception
sep
to a data file separated by
toSep
sep
- separator of the source filetoSep
- separtor of the target filejava.lang.Exception
public void cvtFirstLines(java.lang.String sep1, java.lang.String sep2) throws java.lang.Exception
Source File Format:
First Line: UserID Sep #Ratings
Other Lines: ItemID Sep2 Rating
sep1
- the separtor of the first linesep2
- the separtor of the other linesjava.lang.Exception
public void setSourcePath(java.lang.String sourcePath)
public void setTargetPath(java.lang.String targetPath)