<commit_before>package org.interpss.service;

import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.List;

public class UtilFunc {
	public static String[] getFilenames(String filenames) {
		String[] aryNames = filenames.split(",");
		List<String> list = new ArrayList<>();
		for (String s : aryNames) {
			File path = new File(s.trim());

			if (path.isDirectory()) {
				path.listFiles( new FilenameFilter() { 
					@Override public boolean accept(File dir, String name) { 
						list.add(s.trim() + "/" + name);
						return true; 
					} 
				}); 				
			}
			else
				list.add(s.trim());
		}
		return list.toArray(aryNames);
	}

}<commit_msg>documentation only<commit_after> /*
  * @(#)UtilFunc.java   
  *
  * Copyright (C) 2005-17 www.interpss.org
  *
	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

    	http://www.apache.org/licenses/LICENSE-2.0
    
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
  *
  * @Author <NAME>
  * @Version 1.0
  * @Date 04/7/2017
  * 
  *   Revision History
  *   ================
  *
  */

package org.interpss.service;

import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.List;

/**
 * Utility functions for the PyGateway
 * 
 * @author Mike
 *
 */
public class UtilFunc {
	/**
	 * get file names from the name/dir string
	 * 
	 * @param filenames format: "file1,file2,dir1,dir2,...". 
	 * @return filename array
	 */
	public static String[] getFilenames(String filenames) {
		String[] aryNames = filenames.split(",");
		List<String> list = new ArrayList<>();
		for (String s : aryNames) {
			File path = new File(s.trim());

			if (path.isDirectory()) {
				path.listFiles( new FilenameFilter() { 
					@Override public boolean accept(File dir, String name) { 
						list.add(s.trim() + "/" + name);
						return true; 
					} 
				}); 				
			}
			else
				list.add(s.trim());
		}
		return list.toArray(aryNames);
	}

}
{'fraction_non_alphanumeric': 0.13227739726027396, 'fraction_numerical': 0.009845890410958904, 'mean_word_length': 3.1072056239015815, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7051387', 'n_tokens_mistral': 871, 'n_tokens_neox': 752, 'n_words': 220}