<commit_before>//
//  VerbParser.swift
//  Conjugar
//
//  Created by <NAME> on 4/30/17.
//  Copyright (c) 2017 <NAME>. All rights reserved.
//

import Foundation

class VerbParser: NSObject, XMLParserDelegate {
  private var parser: XMLParser?
  //private var buffer = ""
  private let verbTag = "verb"
  private var verbs: [String: [String: String]] = [:]
  private var currentVerb = ""
  private var currentConjugations: [String: String] = [:]

  override init() {
    super.init()
    if let url = Bundle.main.url(forResource: "verbs", withExtension: "xml") {
      parser = XMLParser(contentsOf: url)
      if parser == nil {
        return
      }
      parser?.delegate = self
    }
  }

  func parse() -> [String: [String: String]] {
    parser?.parse()
    return verbs<commit_msg>remove comment<commit_after>//
//  VerbParser.swift
//  Conjugar
//
//  Created by <NAME> on 4/30/17.
//  Copyright (c) 2017 <NAME>. All rights reserved.
//

import Foundation

class VerbParser: NSObject, XMLParserDelegate {
  private var parser: XMLParser?
  private let verbTag = "verb"
  private var verbs: [String: [String: String]] = [:]
  private var currentVerb = ""
  private var currentConjugations: [String: String] = [:]

  override init() {
    super.init()
    if let url = Bundle.main.url(forResource: "verbs", withExtension: "xml") {
      parser = XMLParser(contentsOf: url)
      if parser == nil {
        return
      }
      parser?.delegate = self
    }
  }

  func parse() -> [String: [String: String]] {
    parser?.parse()
    return verbs
{'fraction_non_alphanumeric': 0.13972955569864778, 'fraction_numerical': 0.01159047005795235, 'mean_word_length': 2.837037037037037, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1173041', 'n_tokens_mistral': 518, 'n_tokens_neox': 485, 'n_words': 143}