<commit_before>/**
 * author: <NAME>  http://github.com/0xor1
 */

part of PurityClient;

bool _hasInitialised = false;

void initPurityAppView(String protocol, InitAppView initAppView, OnConnectionClose onConnectionClose){
  if(_hasInitialised){
    throw 'App view already initialised.';
  }
  _hasInitialised = true;
  var ws = new WebSocket('$protocol://${Uri.base.host}:${Uri.base.port}$PURITY_SOCKET_ROUTE_PATH');
  ws.onOpen.first.then((_) =>
    new PurityClientCore(initAppView, onConnectionClose, ws.onMessage, ws.sendString));
}<commit_msg>fix client side bug<commit_after>/**
 * author: <NAME>  http://github.com/0xor1
 */

part of PurityClient;

bool _hasInitialised = false;

void initPurityAppView(String protocol, InitAppView initAppView, OnConnectionClose onConnectionClose){
  if(_hasInitialised){
    throw 'App view already initialised.';
  }
  _hasInitialised = true;
  var ws = new WebSocket('$protocol://${Uri.base.host}:${Uri.base.port}$PURITY_SOCKET_ROUTE_PATH');
  ws.onOpen.first.then((_) =>
    new PurityClientCore(initAppView, onConnectionClose, ws.onMessage.map((msg) => msg.data), ws.sendString));
}
{'fraction_non_alphanumeric': 0.13969938107869143, 'fraction_numerical': 0.0035366931918656055, 'mean_word_length': 5.431818181818182, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '7370545', 'n_tokens_mistral': 387, 'n_tokens_neox': 377, 'n_words': 74}