<commit_before>module Telmnet where

import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Json.Decode as JsonD
import Regex exposing (regex, contains, split, find)

-- MODEL
type alias Message =
  {
    source: String,
    text: String
  }

type alias Model =
  {
    server: String
  , log: List Message
  , connected: Bool
  , serverInput: String
  , promptInput: String
  , connectionError: Maybe String
  }

newline : Regex.Regex
newline = regex "\n"

newLineStart : Regex.Regex
newLineStart = regex "^\n"

newLineEnd : Regex.Regex
newLineEnd = regex "\n$"

incoming : String
incoming = "in"

outgoing : String
outgoing = "out"

protocol : String
protocol = "ws://"

init : Model
init =
  {
    server = ""
  , log = []
  , connected = False
  , serverInput = protocol
  , promptInput = ""
  , connectionError = Nothing
  }


-- ACTIONS
type Action = Connect String
            | Disconnect (Maybe String)<commit_msg>Make the chat server as pre-filled server input<commit_after>module Telmnet where

import Html exposing (..)
import Html.Events exposing (..)
import Html.Attributes exposing (..)
import Json.Decode as JsonD
import Regex exposing (regex, contains, split, find)

-- MODEL
type alias Message =
  {
    source: String,
    text: String
  }

type alias Model =
  {
    server: String
  , log: List Message
  , connected: Bool
  , serverInput: String
  , promptInput: String
  , connectionError: Maybe String
  }

newline : Regex.Regex
newline = regex "\n"

newLineStart : Regex.Regex
newLineStart = regex "^\n"

newLineEnd : Regex.Regex
newLineEnd = regex "\n$"

incoming : String
incoming = "in"

outgoing : String
outgoing = "out"

protocol : String
protocol = "ws://"

init : Model
init =
  {
    server = ""
  , log = []
  , connected = False
  , serverInput = protocol ++ "vps.rohanjain.in:9000"
  , promptInput = ""
  , connectionError = Nothing
  }


-- ACTIONS
type Action = Connect String
            | Disconnect (Maybe String)
{'fraction_non_alphanumeric': 0.1108337493759361, 'fraction_numerical': 0.00199700449326011, 'mean_word_length': 3.1490683229813663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1138384', 'n_tokens_mistral': 661, 'n_tokens_neox': 643, 'n_words': 197}