public void tag(List<String> sentences,String outputFileName,OutputFormat outputFormat){
  List<Row> rows=new LinkedList<Row>();
  for (  String sentence : sentences) {
    rows.add(RowFactory.create(sentence));
  }
  StructType schema=new StructType(new StructField[]{new StructField("sentence",DataTypes.StringType,false,Metadata.empty())});
  SQLContext sqlContext=new SQLContext(jsc);
  DataFrame input=sqlContext.createDataFrame(rows,schema);
  tag(input,outputFileName,outputFormat);
}

public void tag ( List < String > sentences , String outputFileName , OutputFormat outputFormat ) { List < Row > rows = new LinkedList < Row > ( ) ; for ( String sentence : sentences ) { rows . add ( RowFactory . create ( sentence ) ) ; } StructType schema = new StructType ( new StructField [ ] { new StructField ( "sentence" , DataTypes . StringType , false , Metadata . empty ( ) ) } ) ; SQLContext sqlContext = new SQLContext ( jsc ) ; DataFrame input = sqlContext . createDataFrame ( rows , schema ) ; tag ( input , outputFileName , outputFormat ) ; }
tags a list of sequences and writes the result to an output file with a desired output format .
