<commit_before>// gominisat project main.go
package main

import (
	"fmt"
	"os"
	"runtime/debug"

	"github.com/crillab/gophersat/solver"
)

func main() {
	debug.SetGCPercent(300)
	if len(os.Args) != 2 {
		fmt.Fprintf(os.Stderr, "Syntax : %s file.cnf\n", os.Args[0])
		os.Exit(1)
	}
	f, err := os.Open(os.Args[1])
	if err != nil {
		fmt.Fprintf(os.Stderr, err.Error())
		os.Exit(1)
	}
	defer f.Close()
	fmt.Printf("c ======================================================================================\n")
	fmt.Printf("c | Parsing problem...                                                                 |\n")
	pb, err := solver.ParseCNF(f)
	if err != nil {
		fmt.Fprintf(os.Stderr, err.Error())
		os.Exit(1)
	}
	fmt.Printf("c | Number of clauses   : %9d                                                    |\n", len(pb.Clauses))
	fmt.Printf("c | Number of variables : %9d                                                    |\n", pb.NbVars)
	s := solver.New(pb)<commit_msg>can now read from STDIN<commit_after>// gominisat project main.go
package main

import (
	"fmt"
	"os"
	"runtime/debug"

	"github.com/crillab/gophersat/solver"
)

func main() {
	debug.SetGCPercent(300)
	if len(os.Args) > 2 {
		fmt.Fprintf(os.Stderr, "Syntax : %s [file.cnf]\n", os.Args[0])
		os.Exit(1)
	}
	f := os.Stdin
	if len(os.Args) == 2 {
		var err error
		f, err = os.Open(os.Args[1])
		if err != nil {
			fmt.Fprintf(os.Stderr, "Could not open %s: %v\n", os.Args[1], err.Error())
			os.Exit(1)
		}
		defer f.Close()
	}
	fmt.Printf("c ======================================================================================\n")
	fmt.Printf("c | Parsing problem...                                                                 |\n")
	pb, err := solver.ParseCNF(f)
	if err != nil {
		fmt.Fprintf(os.Stderr, err.Error())
		os.Exit(1)
	}
	fmt.Printf("c | Number of clauses   : %9d                                                    |\n", len(pb.Clauses))
	fmt.Printf("c | Number of variables : %9d                                                    |\n", pb.NbVars)
	s := solver.New(pb)
{'fraction_non_alphanumeric': 0.23703344643722735, 'fraction_numerical': 0.0116335433834222, 'mean_word_length': 1.9655172413793103, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2151459', 'n_tokens_mistral': 748, 'n_tokens_neox': 712, 'n_words': 147}