<commit_before>## SubtitlesParser
===============

Universal subtitles parser which aims at supporting all subtitle formats.
For more info on subtitles formats, see this page: http://en.wikipedia.org/wiki/Category:Subtitle_file_formats

For now, 4 different formats are supported:
* SubRip	https://github.com/AlexPoint/SubtitlesParser/blob/master/SubtitlesParser/Classes/Parsers/SrtParser.cs
* SubViewer	https://github.com/AlexPoint/SubtitlesParser/blob/master/SubtitlesParser/Classes/Parsers/SubViewerSubParser.cs
* SubStationAlpha	https://github.com/AlexPoint/SubtitlesParser/blob/master/SubtitlesParser/Classes/Parsers/SsaParser.cs
* MicroDvd	https://github.com/AlexPoint/SubtitlesParser/blob/master/SubtitlesParser/Classes/Parsers/MicroDvdSubParser.cs<commit_msg>New: added quickstart section to readme<commit_after>## SubtitlesParser
===============

Universal subtitles parser which aims at supporting all subtitle formats.
For more info on subtitles formats, see this page: http://en.wikipedia.org/wiki/Category:Subtitle_file_formats

For now, 4 different formats are supported:
* SubRip	https://github.com/AlexPoint/SubtitlesParser/blob/master/SubtitlesParser/Classes/Parsers/SrtParser.cs
* SubViewer	https://github.com/AlexPoint/SubtitlesParser/blob/master/SubtitlesParser/Classes/Parsers/SubViewerParser.cs
* SubStationAlpha	https://github.com/AlexPoint/SubtitlesParser/blob/master/SubtitlesParser/Classes/Parsers/SsaParser.cs
* MicroDvd	https://github.com/AlexPoint/SubtitlesParser/blob/master/SubtitlesParser/Classes/Parsers/MicroDvdParser.cs


### Quickstart

You can check the Test project for more sample codes.

#### Universal parser

If you don't specify the subtitle format, the SubtitlesParser will try all the registered parsers (4 for now)

	var parser = new SubtitlesParser.Classes.Parsers.SubtitlesParser();
	using (var fileStream = File.OpenRead(pathToSrtFile)){
		var items = parser.ParseStream(fileStream);
	}


#### Specific parser

You can use a specific parser if you know the format of the files you parse.
For example, for parsing a srt file:

	var parser = new SubtitlesParser.Classes.Parsers.SrtParser();
	using (var fileStream = File.OpenRead(pathToSrtFile)){
		var items = parser.ParseStream(fileStream);
	}
{'fraction_non_alphanumeric': 0.10615521855486174, 'fraction_numerical': 0.0013380909901873326, 'mean_word_length': 5.944272445820434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, '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': '1708802', 'n_tokens_mistral': 692, 'n_tokens_neox': 674, 'n_words': 156}