<commit_before>#include <BALL/FORMAT/molFileFactory.h>

#include <BALL/FORMAT/genericMolFile.h>
#include <BALL/FORMAT/PDBFile.h>
#include <BALL/FORMAT/HINFile.h>
#include <BALL/FORMAT/MOLFile.h>
#include <BALL/FORMAT/MOL2File.h>
//#include <BALL/FORMAT/XYZFile.h>

#include <BALL/DATATYPE/string.h>

namespace BALL
{

GenericMolFile* MolFileFactory::open(const String& name, File::OpenMode open_mode)
{
    String tmp = name.right(5);
    tmp.toLower(0, 5);

    if(tmp.hasSuffix(".pdb") || tmp.hasSuffix(".ent") || tmp.hasSuffix(".brk")) {
        return new PDBFile(name, open_mode);
    } else if(tmp.hasSuffix(".hin")) {
        return new HINFile(name, open_mode);
    } else if(tmp.hasSuffix(".mol")) {
        return new MOLFile(name, open_mode);
    } else if(tmp.hasSuffix(".mol2")) {
        return new MOL2File(name, open_mode);
//    } else if(tmp.hasSuffix(".xyz")) {
//        return new XYZFile(name, open_mode);
    } else {
        return NULL;
    }
}

}
<commit_msg>Added SDFile support to the MolFileFactory<commit_after>#include <BALL/FORMAT/molFileFactory.h>

#include <BALL/FORMAT/genericMolFile.h>
#include <BALL/FORMAT/PDBFile.h>
#include <BALL/FORMAT/HINFile.h>
#include <BALL/FORMAT/MOLFile.h>
#include <BALL/FORMAT/MOL2File.h>
#include <BALL/FORMAT/SDFile.h>
//#include <BALL/FORMAT/XYZFile.h>

#include <BALL/DATATYPE/string.h>

namespace BALL
{

	GenericMolFile* MolFileFactory::open(const String& name, File::OpenMode open_mode)
	{
		String tmp = name.right(5);
		tmp.toLower(0, 5);

		if(tmp.hasSuffix(".pdb") || tmp.hasSuffix(".ent") || tmp.hasSuffix(".brk")) {
			return new PDBFile(name, open_mode);
		} else if(tmp.hasSuffix(".hin")) {
			return new HINFile(name, open_mode);
		} else if(tmp.hasSuffix(".mol")) {
			return new MOLFile(name, open_mode);
		} else if(tmp.hasSuffix(".sdf")) {
			return new SDFile(name, open_mode);
		} else if(tmp.hasSuffix(".mol2")) {
			return new MOL2File(name, open_mode);
	//	} else if(tmp.hasSuffix(".xyz")) {
	//		return new XYZFile(name, open_mode);
		} else {
			return NULL;
		}
	}

}

{'fraction_non_alphanumeric': 0.17361784675072744, 'fraction_numerical': 0.005819592628516004, 'mean_word_length': 3.947242206235012, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '3688659', 'n_tokens_mistral': 843, 'n_tokens_neox': 806, 'n_words': 139}