<commit_before>//
//  DemoStrings.swift
//
//  Created by <NAME> on 8/26/16.
//  Copyright © 2016 Raizlabs. All rights reserved.
//

import BonMot

enum DemoStrings {
    static let colorString: NSAttributedString = {
        // Define a colored image that's slightly shifted to account for the line height
        let racket = UIImage(named: "Tennis Racket")!.styled(with:
            .color(.raizlabsRed), .baselineOffset(-4.0))

        let gray = AttributedStringStyle.style(
            .font(BONFont(name: "GillSans-Light", size: 20)!),
            .lineHeightMultiple(1.8),
            .color(.darkGray))
        let accent = gray.derive(.font(BONFont(name: "SuperClarendon-Black", size: 20)!))

        let black = accent.derive(.color(.white), .backgroundColor(.black))
        let red = accent.derive(.color(.white), .backgroundColor(.raizlabsRed))
        let signed = accent.derive(.color(.raizlabsRed))

        return NSAttributedString.composed(of: [
            "I want to be different. If everyone is wearing ",
            "\(Special.noBreakSpace)black,\(Special.noBreakSpace)".styled(with: black),
            " I want to be wearing ",
            "\(Special.noBreakSpace)red.\(Special.noBreakSpace)".styled(with: red),
            "\n<NAME> ".styled(with: signed),
            racket
            ], baseStyle: gray)
    }()

    static let colorStringXML: NSAttributedString = {
        // Define a colored image that's slightly shifted to account for the line height
        let racket = UIImage(named: "Tennis Racket")!.styled(with:
            .color(.raizlabsRed), .baselineOffset(-4.0))

        // Define styles
        let accent = AttributedStringStyle.style(.font(BONFont(name: "SuperClarendon-Black", size: 20)!))
        let black = accent.derive(.color(.white), .backgroundColor(.black))
        let red = accent.derive(.color(.white), .backgroundColor(.raizlabsRed))
        let signed = accent.derive(.color(.raizlabsRed))

        // Define the base style with xml rules for all tags
        let baseStyle = AttributedStringStyle.style(
            .font(BONFont(name: "GillSans-Light", size: 20)!),
            .lineHeightMultiple(1.8),
            .color(.darkGray),
            .xmlRules([
                .style("black", black),
                .style("red", red),
                .style("signed", signed),
                .enter(element: "racket", insert: racket)
                ]
            )
        )<commit_msg>Fix compilation error caused by changed name.<commit_after>//
//  DemoStrings.swift
//
//  Created by <NAME> on 8/26/16.
//  Copyright © 2016 Raizlabs. All rights reserved.
//

import BonMot

enum DemoStrings {
    static let colorString: NSAttributedString = {
        // Define a colored image that's slightly shifted to account for the line height
        let racket = UIImage(named: "Tennis Racket")!.styled(with:
            .color(.raizlabsRed), .baselineOffset(-4.0))

        let gray = AttributedStringStyle.style(
            .font(BONFont(name: "GillSans-Light", size: 20)!),
            .lineHeightMultiple(1.8),
            .color(.darkGray))
        let accent = gray.byAdding(.font(BONFont(name: "SuperClarendon-Black", size: 20)!))

        let black = accent.byAdding(.color(.white), .backgroundColor(.black))
        let red = accent.byAdding(.color(.white), .backgroundColor(.raizlabsRed))
        let signed = accent.byAdding(.color(.raizlabsRed))

        return NSAttributedString.composed(of: [
            "I want to be different. If everyone is wearing ",
            "\(Special.noBreakSpace)black,\(Special.noBreakSpace)".styled(with: black),
            " I want to be wearing ",
            "\(Special.noBreakSpace)red.\(Special.noBreakSpace)".styled(with: red),
            "\n<NAME> ".styled(with: signed),
            racket
            ], baseStyle: gray)
    }()

    static let colorStringXML: NSAttributedString = {
        // Define a colored image that's slightly shifted to account for the line height
        let racket = UIImage(named: "<NAME>")!.styled(with:
            .color(.raizlabsRed), .baselineOffset(-4.0))

        // Define styles
        let accent = AttributedStringStyle.style(.font(BONFont(name: "SuperClarendon-Black", size: 20)!))
        let black = accent.byAdding(.color(.white), .backgroundColor(.black))
        let red = accent.byAdding(.color(.white), .backgroundColor(.raizlabsRed))
        let signed = accent.byAdding(.color(.raizlabsRed))

        // Define the base style with xml rules for all tags
        let baseStyle = AttributedStringStyle.style(
            .font(BONFont(name: "GillSans-Light", size: 20)!),
            .lineHeightMultiple(1.8),
            .color(.darkGray),
            .xmlRules([
                .style("black", black),
                .style("red", red),
                .style("signed", signed),
                .enter(element: "racket", insert: racket)
                ]
            )
        )
{'fraction_non_alphanumeric': 0.13385826771653545, 'fraction_numerical': 0.010094891984655765, 'mean_word_length': 2.261356155365372, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '1359207', 'n_tokens_mistral': 1554, 'n_tokens_neox': 1405, 'n_words': 339}