<commit_before>// Copyright 2011 Google Inc. All Rights Reserved.
// This file is available under the Apache license.

package main

import "fmt"

func unparse(n node) string {
	output := ""

	switch v := n.(type) {
	case *stmtlistNode:
		for _, child := range v.children {
			output += unparse(child) + "\n"
		}

	case *exprlistNode:
		if len(v.children) > 0 {
			output += unparse(v.children[0])
			for _, child := range v.children[1:] {
				output += ", " + unparse(child)
			}
		}

	case *condNode:
		if v.cond != nil {
			output += unparse(v.cond)
		}
		output += " {\n"
		for _, child := range v.children {
			output += unparse(child)
		}
		output += "}\n"

	case *regexNode:
		output += "/" + v.pattern + "/"<commit_msg>Unparse relNodes back into their textual representation.<commit_after>// Copyright 2011 Google Inc. All Rights Reserved.
// This file is available under the Apache license.

package main

import "fmt"

func unparse(n node) string {
	output := ""

	switch v := n.(type) {
	case *stmtlistNode:
		for _, child := range v.children {
			output += unparse(child) + "\n"
		}

	case *exprlistNode:
		if len(v.children) > 0 {
			output += unparse(v.children[0])
			for _, child := range v.children[1:] {
				output += ", " + unparse(child)
			}
		}

	case *condNode:
		if v.cond != nil {
			output += unparse(v.cond)
		}
		output += " {\n"
		for _, child := range v.children {
			output += unparse(child)
		}
		output += "}\n"

	case *regexNode:
		output += "/" + v.pattern + "/"

	case *relNode:
		output += unparse(v.lhs)
		switch v.op {
		case LT:
			output += " < "
		case GT:
			output += " > "
		case LE:
			output += " <= "
		case GE:
			output += " >= "
		case EQ:
			output += " == "
		case NE:
			output += " != "
		}
		output += unparse(v.rhs)
{'fraction_non_alphanumeric': 0.1670428893905192, 'fraction_numerical': 0.007900677200902935, 'mean_word_length': 2.670807453416149, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7075100', 'n_tokens_mistral': 728, 'n_tokens_neox': 629, 'n_words': 174}