<commit_before>/**
 * @file	KEEnumTable.swift
 * @brief	Define KEEnumTable class
 * @par Copyright
 *   Copyright (C) 2018 Steel Wheels Project
 */

import CoconutData
import Foundation

public class KEEnumTable
{
	public static let shared = KEEnumTable()

	private var mEnumTypes:	Dictionary<String, KEEnumType>

	public var typeNames: Array<String> { get { return Array(mEnumTypes.keys) }}

	private init(){
		mEnumTypes = [:]
		setup()
	}

	private func setup(){
		let exitcode = KEEnumType(typeName: "ExitCode")
		exitcode.add(members: [
			KEEnumType.Member(name: "noError",		value: CNExitCode.NoError.rawValue),
			KEEnumType.Member(name: "internalError",	value: CNExitCode.InternalError.rawValue),
			KEEnumType.Member(name: "commaneLineError",	value: CNExitCode.CommandLineError.rawValue),
			KEEnumType.Member(name: "syntaxError",		value: CNExitCode.SyntaxError.rawValue),
			KEEnumType.Member(name: "exception",		value: CNExitCode.Exception.rawValue)
			])
		mEnumTypes[exitcode.typeName] = exitcode

		let filetype = KEEnumType(typeName: "FileType")
		filetype.add(members: [
			KEEnumType.Member(name: "notExist", 		value: CNFileType.NotExist.rawValue),
			KEEnumType.Member(name: "file", 		value: CNFileType.File.rawValue),
			KEEnumType.Member(name: "directory", 		value: CNFileType.Directory.rawValue),
		])
		mEnumTypes[filetype.typeName] = filetype

		let axis = KEEnumType(typeName: "Axis")
		axis.add(members: [
			KEEnumType.Member(name: "horizontal",	value: CNAxis.horizontal.rawValue),
			KEEnumType.Member(name: "vertical",	value: CNAxis.vertical.rawValue)
		])
		mEnumTypes[axis.typeName] = axis

		let alignment = KEEnumType(typeName: "Alignment")
		alignment.add(members: [
			KEEnumType.Member(name: "leading",	value: CNAlignment.leading.rawValue),
			KEEnumType.Member(name: "trailing",	value: CNAlignment.trailing.rawValue),
			KEEnumType.Member(name: "fill",		value: CNAlignment.fill.rawValue),
			KEEnumType.Member(name: "center",	value: CNAlignment.center.rawValue)
		])
		mEnumTypes[alignment.typeName] = alignment

		let distribution = KEEnumType(typeName: "Distribution")
		distribution.add(members: [
			KEEnumType.Member(name: "fill",		value: CNDistribution.fill.rawValue),
			KEEnumType.Member(name: "fillEqually",	value: CNDistribution.fillEqually.rawValue),
			KEEnumType.Member(name: "equalSpacing",	value: CNDistribution.equalSpacing.rawValue),
		])
		mEnumTypes[distribution.typeName] = distribution

		let textalign = KEEnumType(typeName: "TextAlign")
		textalign.add(members: [
			KEEnumType.Member(name: "left",		value: Int32(NSTextAlignment.left.rawValue)),
			KEEnumType.Member(name: "center",	value: Int32(NSTextAlignment.center.rawValue)),<commit_msg>KiwiEngine: Update to support latest CoconutData framework<commit_after>/**
 * @file	KEEnumTable.swift
 * @brief	Define KEEnumTable class
 * @par Copyright
 *   Copyright (C) 2018 Steel Wheels Project
 */

import CoconutData
import Foundation

public class KEEnumTable
{
	public static let shared = KEEnumTable()

	private var mEnumTypes:	Dictionary<String, KEEnumType>

	public var typeNames: Array<String> { get { return Array(mEnumTypes.keys) }}

	private init(){
		mEnumTypes = [:]
		setup()
	}

	private func setup(){
		let exitcode = KEEnumType(typeName: "ExitCode")
		exitcode.add(members: [
			KEEnumType.Member(name: "noError",		value: CNExitCode.NoError.rawValue),
			KEEnumType.Member(name: "internalError",	value: CNExitCode.InternalError.rawValue),
			KEEnumType.Member(name: "commaneLineError",	value: CNExitCode.CommandLineError.rawValue),
			KEEnumType.Member(name: "syntaxError",		value: CNExitCode.SyntaxError.rawValue),
			KEEnumType.Member(name: "exception",		value: CNExitCode.Exception.rawValue)
			])
		mEnumTypes[exitcode.typeName] = exitcode

		let filetype = KEEnumType(typeName: "FileType")
		filetype.add(members: [
			KEEnumType.Member(name: "notExist", 		value: CNFileType.NotExist.rawValue),
			KEEnumType.Member(name: "file", 		value: CNFileType.File.rawValue),
			KEEnumType.Member(name: "directory", 		value: CNFileType.Directory.rawValue),
		])
		mEnumTypes[filetype.typeName] = filetype

		let axis = KEEnumType(typeName: "Axis")
		axis.add(members: [
			KEEnumType.Member(name: "horizontal",	value: CNAxis.horizontal.rawValue),
			KEEnumType.Member(name: "vertical",	value: CNAxis.vertical.rawValue)
		])
		mEnumTypes[axis.typeName] = axis

		let alignment = KEEnumType(typeName: "Alignment")
		alignment.add(members: [
			KEEnumType.Member(name: "leading",	value: CNAlignment.leading.rawValue),
			KEEnumType.Member(name: "trailing",	value: CNAlignment.trailing.rawValue),
			KEEnumType.Member(name: "fill",		value: CNAlignment.fill.rawValue),
			KEEnumType.Member(name: "center",	value: CNAlignment.center.rawValue)
		])
		mEnumTypes[alignment.typeName] = alignment

		let distribution = KEEnumType(typeName: "Distribution")
		distribution.add(members: [
			KEEnumType.Member(name: "fillProportinally",	value: CNDistribution.fillProportinally.rawValue),
			KEEnumType.Member(name: "fillEqually",		value: CNDistribution.fillEqually.rawValue),
			KEEnumType.Member(name: "equalSpacing",		value: CNDistribution.equalSpacing.rawValue),
		])
		mEnumTypes[distribution.typeName] = distribution

		let textalign = KEEnumType(typeName: "TextAlign")
		textalign.add(members: [
			KEEnumType.Member(name: "left",		value: Int32(NSTextAlignment.left.rawValue)),
			KEEnumType.Member(name: "center",	value: Int32(NSTextAlignment.center.rawValue)),
{'fraction_non_alphanumeric': 0.12769455608330288, 'fraction_numerical': 0.0029229082937522835, 'mean_word_length': 5.61231884057971, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3499796', 'n_tokens_mistral': 2039, 'n_tokens_neox': 1829, 'n_words': 329}