<commit_before>import { DotBase } from '../common';
import { IEdgeTarget } from '../common/interface';
import { Attributes } from './attributes';
import { IContext } from './Context';
import { isEdgeTarget } from './Node';

/**
 * @category Primary
 */
export class Edge extends DotBase {
  public readonly attributes = new Attributes();
  public readonly targets: IEdgeTarget[];

  constructor(context: IContext, target1: IEdgeTarget, target2: IEdgeTarget);
  constructor(context: IContext, ...targets: IEdgeTarget[]);
  constructor(private context: IContext, target1: IEdgeTarget, target2: IEdgeTarget, ...targets: IEdgeTarget[]) {
    super();
    this.targets = [target1, target2, ...targets].filter(n => isEdgeTarget(n));
  }

  public toDot(): string {
    const arrow = this.context.graphType === 'digraph' ? '->' : '--';
    const target = this.targets.map(n => n.toEdgeTargetDot()).join(` ${arrow} `);
    const attrs = this.attributes.size > 0 ? ` ${this.attributes.toDot()}` : '';
    const src = `${target}${attrs};`;
    return src;
  }
}
<commit_msg>fix typo<commit_after>import { DotBase } from '../common';
import { IEdgeTarget } from '../common/interface';
import { Attributes } from './Attributes';
import { IContext } from './Context';
import { isEdgeTarget } from './Node';

/**
 * @category Primary
 */
export class Edge extends DotBase {
  public readonly attributes = new Attributes();
  public readonly targets: IEdgeTarget[];

  constructor(context: IContext, target1: IEdgeTarget, target2: IEdgeTarget);
  constructor(context: IContext, ...targets: IEdgeTarget[]);
  constructor(private context: IContext, target1: IEdgeTarget, target2: IEdgeTarget, ...targets: IEdgeTarget[]) {
    super();
    this.targets = [target1, target2, ...targets].filter(n => isEdgeTarget(n));
  }

  public toDot(): string {
    const arrow = this.context.graphType === 'digraph' ? '->' : '--';
    const target = this.targets.map(n => n.toEdgeTargetDot()).join(` ${arrow} `);
    const attrs = this.attributes.size > 0 ? ` ${this.attributes.toDot()}` : '';
    const src = `${target}${attrs};`;
    return src;
  }
}

{'fraction_non_alphanumeric': 0.17522373999057936, 'fraction_numerical': 0.00659444182760245, 'mean_word_length': 4.057142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3346864', 'n_tokens_mistral': 647, 'n_tokens_neox': 634, 'n_words': 167}