<commit_before>package com.rockhoppertech.music.fx.cmn.model;

/*
 * #%L
 * Rocky Music FX
 * %%
 * Copyright (C) 1996 - 2014 Rockhopper Technologies
 * %%
 * 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.
 * #L%
 */

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

import javafx.geometry.Point2D;

import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonNumber;
import javax.json.JsonObject;
import javax.json.JsonReader;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author <a href="http://genedelisa.com/"><NAME></a>
 * 
 */
public class SymbolFactory {
    private static final Logger logger = LoggerFactory
            .getLogger(SymbolFactory.class);

    static {
        readJson();
    }

    private static JsonObject glyphs;
    private static JsonObject fontMetaData;
    private static JsonObject engravingDefaults;

    /**
     * No instantiation.
     */
    private SymbolFactory() {

    }

    public static final String getGlyph(final String name) {
        if (glyphs == null) {
            logger.debug("null glyphs!");
            return null;
        }
        String s = glyphs.getJsonObject(name).getString(
                "codepoint");
        // the string will have this prefix: E+, so skip that.
        int i = Integer.parseInt(s.substring(1), 16);
        return unicodeToString(i);
    }

    public static final String unicodeToString(final int codePoint) {
        // for equivalence with U+n, below would be 0xnnnn
        // converting to char[] pair
        char[] charPair = Character.toChars(codePoint);
        // and to String, containing the character we want
        String symbol = new String(charPair);
        return symbol;
    }

    // symbol accessors
    public static final String flat() {
        return getGlyph("accidentalFlat");
    }
    
    public static final String sharp() {
        return getGlyph("accidentalSharp");
    }
    
    public static final String natural() {
        return getGlyph("accidentalNatural");
    }
    
    

    public static final String noteQuarterUp() {
        return getGlyph("noteQuarterUp");
    }

    public static final String noteQuarterDown() {
        return getGlyph("noteQuarterDown");
    }

    public static final String noteQuarterUpFlat() {
        return flat() + getGlyph("noteQuarterUp");
    }

    public static final String noteQuarterDownFlat() {
        return flat() + getGlyph("noteQuarterDown");
    }
    
    public static final String noteQuarterUpSharp() {
        return sharp() + getGlyph("noteQuarterUp");
    }

    public static final String noteQuarterDownSharp() {
        return sharp() + getGlyph("noteQuarterDown");
    }
    
    public static final String noteheadBlack() {
        return getGlyph("noteheadBlack");
    }
    
    public static final String gClef() {
        return getGlyph("gClef");
    }
    public static final String fClef() {
        return getGlyph("fClef");
    }
    public static final String cClef() {
        return getGlyph("cClef");
    }
    
    public static final String staff5Lines() {
        return getGlyph("staff5Lines");
    }
    public static final String staff1Line() {
        return getGlyph("staff1Line");
    }
    public static final String staff1LineWide() {
        return getGlyph("staff1LineWide");
    }
    public static final String augmentationDot() {
        return getGlyph("augmentationDot");
    }
    
   
    
    // 
    public static final String flag8thDown() {
        return getGlyph("flag8thDown");
    }
    public static final String flag8thUp() {
        return getGlyph("flag8thUp");
    }
    public static final String flag16thUp() {
        return getGlyph("flag16thUp");
    }
    public static final String flag16thDown() {
        return getGlyph("flag16thDown");
    }
    
    
    
    
    
    public static final String noteWhole() {
        return getGlyph("noteWhole");
    }
    public static final String noteheadHalf() {
        return getGlyph("noteheadHalf");
    }
    public static final String noteHalfUp() {
        return getGlyph("noteHalfUp");
    }
    public static final String noteHalfDown() {<commit_msg>32nd and 64th flags<commit_after>package com.rockhoppertech.music.fx.cmn.model;

/*
 * #%L
 * Rocky Music FX
 * %%
 * Copyright (C) 1996 - 2014 Rockhopper Technologies
 * %%
 * 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.
 * #L%
 */

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;

import javafx.geometry.Point2D;

import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonNumber;
import javax.json.JsonObject;
import javax.json.JsonReader;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author <a href="http://genedelisa.com/"><NAME></a>
 * 
 */
public class SymbolFactory {
    private static final Logger logger = LoggerFactory
            .getLogger(SymbolFactory.class);

    static {
        readJson();
    }

    private static JsonObject glyphs;
    private static JsonObject fontMetaData;
    private static JsonObject engravingDefaults;

    /**
     * No instantiation.
     */
    private SymbolFactory() {

    }

    public static final String getGlyph(final String name) {
        if (glyphs == null) {
            logger.debug("null glyphs!");
            return null;
        }
        String s = glyphs.getJsonObject(name).getString(
                "codepoint");
        // the string will have this prefix: E+, so skip that.
        int i = Integer.parseInt(s.substring(1), 16);
        return unicodeToString(i);
    }

    public static final String unicodeToString(final int codePoint) {
        // for equivalence with U+n, below would be 0xnnnn
        // converting to char[] pair
        char[] charPair = Character.toChars(codePoint);
        // and to String, containing the character we want
        String symbol = new String(charPair);
        return symbol;
    }

    // symbol accessors
    public static final String flat() {
        return getGlyph("accidentalFlat");
    }
    
    public static final String sharp() {
        return getGlyph("accidentalSharp");
    }
    
    public static final String natural() {
        return getGlyph("accidentalNatural");
    }
    
    

    public static final String noteQuarterUp() {
        return getGlyph("noteQuarterUp");
    }

    public static final String noteQuarterDown() {
        return getGlyph("noteQuarterDown");
    }

    public static final String noteQuarterUpFlat() {
        return flat() + getGlyph("noteQuarterUp");
    }

    public static final String noteQuarterDownFlat() {
        return flat() + getGlyph("noteQuarterDown");
    }
    
    public static final String noteQuarterUpSharp() {
        return sharp() + getGlyph("noteQuarterUp");
    }

    public static final String noteQuarterDownSharp() {
        return sharp() + getGlyph("noteQuarterDown");
    }
    
    public static final String noteheadBlack() {
        return getGlyph("noteheadBlack");
    }
    
    public static final String gClef() {
        return getGlyph("gClef");
    }
    public static final String fClef() {
        return getGlyph("fClef");
    }
    public static final String cClef() {
        return getGlyph("cClef");
    }
    
    public static final String staff5Lines() {
        return getGlyph("staff5Lines");
    }
    public static final String staff1Line() {
        return getGlyph("staff1Line");
    }
    public static final String staff1LineWide() {
        return getGlyph("staff1LineWide");
    }
    public static final String augmentationDot() {
        return getGlyph("augmentationDot");
    }
    
   
    
    // 
    public static final String flag8thDown() {
        return getGlyph("flag8thDown");
    }
    public static final String flag8thUp() {
        return getGlyph("flag8thUp");
    }
    public static final String flag16thUp() {
        return getGlyph("flag16thUp");
    }
    public static final String flag16thDown() {
        return getGlyph("flag16thDown");
    }
    public static final String flag32ndDown() {
        return getGlyph("flag32ndDown");
    }
    public static final String flag32ndUp() {
        return getGlyph("flag32ndUp");
    }
    public static final String flag64thDown() {
        return getGlyph("flag64thDown");
    }
    public static final String flag64thUp() {
        return getGlyph("flag64thUp");
    }
    
    
    public static final String noteWhole() {
        return getGlyph("noteWhole");
    }
    public static final String noteheadHalf() {
        return getGlyph("noteheadHalf");
    }
    public static final String noteHalfUp() {
        return getGlyph("noteHalfUp");
    }
    public static final String noteHalfDown() {
{'fraction_non_alphanumeric': 0.09640273107102823, 'fraction_numerical': 0.00957912972587384, 'mean_word_length': 2.6200663961637773, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '683510', 'n_tokens_mistral': 2859, 'n_tokens_neox': 2711, 'n_words': 817}