<commit_before>package com.mamewo.malarm;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Vector;

/**
 * @author <NAME> <<EMAIL>>
 */

public class M3UPlaylist implements Playlist{
	private int _nextindex = 0;
	String _basepath;
	private Vector<String> _playlist;
	
	public M3UPlaylist(String basepath, String playlistpath) {
		_basepath = basepath;
		String sep = System.getProperty("file.separator");
		if (! _basepath.endsWith(sep)) {
			_basepath = _basepath + sep;
		}
		try {
			_playlist = new Vector<String>();
			loadPlaylist(playlistpath);
		} catch (FileNotFoundException e) {
			//TODO: set default playlist?
			e.printStackTrace();
		} catch (IOException e) {
			//TODO: set default playlist?
			e.printStackTrace();
		}
	}
	
	@Override
	public boolean isEmpty() {
		return _playlist.isEmpty();
	}
	
	@Override
	public String next() {
		if (_playlist.size() <= _nextindex) {
			_nextindex = 0;
		}
		String result = _playlist.get(_nextindex);
		_nextindex++;
		return _basepath + result;
	}

	@Override
	public void reset() {
		_nextindex = 0;
	}

	protected void loadPlaylist(String filename) throws FileNotFoundException, IOException {
		BufferedReader br = new BufferedReader(new FileReader (filename));
		String music_filename;
		while ((music_filename = br.readLine()) != null) {
			_playlist.add(music_filename);
		}
		br.close();
	}
}
<commit_msg>support full path of music filename ignore directive in m3u file<commit_after>package com.mamewo.malarm;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Vector;

/**
 * @author <NAME> <<EMAIL>>
 */

public class M3UPlaylist implements Playlist{
	private int _nextindex = 0;
	String _basepath;
	private Vector<String> _playlist;
	
	public M3UPlaylist(String basepath, String playlistpath) {
		_basepath = basepath;
		String sep = System.getProperty("file.separator");
		if (! _basepath.endsWith(sep)) {
			_basepath = _basepath + sep;
		}
		try {
			_playlist = new Vector<String>();
			loadPlaylist(playlistpath);
		} catch (FileNotFoundException e) {
			//TODO: set default playlist?
			e.printStackTrace();
		} catch (IOException e) {
			//TODO: set default playlist?
			e.printStackTrace();
		}
	}
	
	@Override
	public boolean isEmpty() {
		return _playlist.isEmpty();
	}
	
	@Override
	public String next() {
		if (_playlist.size() <= _nextindex) {
			_nextindex = 0;
		}
		String result = _playlist.get(_nextindex);
		_nextindex++;
		if (result.indexOf(System.getProperty("file.separator")) == -1) {
			result = _basepath + result;
		}
		return result;
	}

	@Override
	public void reset() {
		_nextindex = 0;
	}

	protected void loadPlaylist(String filename) throws FileNotFoundException, IOException {
		BufferedReader br = new BufferedReader(new FileReader (filename));
		String music_filename;
		while ((music_filename = br.readLine()) != null) {
			if (! music_filename.startsWith("#")) {
				_playlist.add(music_filename);
			}
		}
		br.close();
	}
}

{'fraction_non_alphanumeric': 0.12291399229781771, 'fraction_numerical': 0.0038510911424903724, 'mean_word_length': 4.160596026490066, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6330291', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1018, 'n_words': 245}