<commit_before>import Data
import JSON


public class DefaultEventMatcher : EventMatcher {
  public enum Error : ErrorType {
    case EventUnmatch
    case InvalidJson
  }
  public func matchWithRawData(rawdata: Data) throws -> RTMEvent? {
    let eventJson: JSON = try JSONParser().parse(rawdata)
    return try self.matchWithJSONData(eventJson)
  }
  public func matchWithJSONData(jsondata: JSON) throws -> RTMEvent? {
    if HelloEvent.isJSOMMatch(jsondata) {
      return try HelloEvent(rawdata: nil,jsondata: jsondata)
    }
    if MessageEvent.isJSOMMatch(jsondata) {
      return try MessageEvent(rawdata: nil,jsondata: jsondata)
    }<commit_msg>Issue #5983 reply feature<commit_after>import Data
import JSON


public class DefaultEventMatcher : EventMatcher {
  public enum Error : ErrorType {
    case EventUnmatch
    case InvalidJson
  }
  public func matchWithRawData(rawdata: Data) throws -> RTMEvent? {
    let eventJson: JSON = try JSONParser().parse(rawdata)
    return try self.matchWithJSONData(eventJson)
  }
  public func matchWithJSONData(jsondata: JSON) throws -> RTMEvent? {
    if HelloEvent.isJSOMMatch(jsondata) {
      return try HelloEvent(rawdata: nil,jsondata: jsondata)
    }
    if MessageEvent.isJSOMMatch(jsondata) {
      return try MessageEvent(rawdata: nil,jsondata: jsondata)
    }
    print(jsondata)
{'fraction_non_alphanumeric': 0.08134328358208955, 'fraction_numerical': 0.0029850746268656717, 'mean_word_length': 4.137931034482759, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2865755', 'n_tokens_mistral': 408, 'n_tokens_neox': 416, 'n_words': 104}