<commit_before>#     NoFlo - Flow-Based Programming for JavaScript
#     (c) 2013-2017 Flowhub UG
#     (c) 2011-2012 <NAME>, Nemein
#     NoFlo may be freely distributed under the MIT license
#
# Regular port for NoFlo components.
{EventEmitter} = require 'events'
platform = require './Platform'

class Port extends EventEmitter
  description: ''
  required: true
  constructor: (@type) ->
    platform.deprecated 'noflo.Port is deprecated. Please port to noflo.InPort/noflo.OutPort'
    @type = 'all' unless @type
    @type = 'int' if @type is 'integer'
    @sockets = []
    @from = null
    @node = null
    @name = null

  getId: ->
    unless @node and @name
      return 'Port'
    "#{@node} #{@name.toUpperCase()}"

  getDataType: -> @type
  getDescription: -> @description

  attach: (socket) ->
    @sockets.push socket<commit_msg>Add getSchema method also for legacy ports<commit_after>#     NoFlo - Flow-Based Programming for JavaScript
#     (c) 2013-2017 Flowhub UG
#     (c) 2011-2012 <NAME>, Nemein
#     NoFlo may be freely distributed under the MIT license
#
# Regular port for NoFlo components.
{EventEmitter} = require 'events'
platform = require './Platform'

class Port extends EventEmitter
  description: ''
  required: true
  constructor: (@type) ->
    platform.deprecated 'noflo.Port is deprecated. Please port to noflo.InPort/noflo.OutPort'
    @type = 'all' unless @type
    @type = 'int' if @type is 'integer'
    @sockets = []
    @from = null
    @node = null
    @name = null

  getId: ->
    unless @node and @name
      return 'Port'
    "#{@node} #{@name.toUpperCase()}"

  getDataType: -> @type
  getSchema: -> null
  getDescription: -> @description

  attach: (socket) ->
    @sockets.push socket
{'fraction_non_alphanumeric': 0.12399077277970011, 'fraction_numerical': 0.01845444059976932, 'mean_word_length': 3.1016548463356974, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '468646', 'n_tokens_mistral': 585, 'n_tokens_neox': 554, 'n_words': 177}