#!/usr/bin/mumps
# Copyright 2014, 2022, 2023 Kevin C. O'Kane

# preprocess.mps May 15, 2022

	zmain

	set %=$zStopInit("basic.stop.words")

	set min=%1

L1	read line
	if '$test goto L2
	write $p(line," ",1,2)
#	set line=$translate(line,"0123456789""`~!@#$%^&*()_+=?>.<,:;'{[}]")
#	set line=$zblanks(line)
	set i=2

L3	set i=i+1
	s w=$p(line," ",i)
	if $l(w)=0 write ! goto L1
	if $l(w)<min goto L3
	if $zStopLookup(w) goto L3
	if $e(w,1,1)="-" set w=$e(w,2,99)
	set x=$zstem(w)
	set ^stem(x,w)=""
	write " ",x
	goto L3

L2	halt
