A method for discretizing the continuum by using a transformed harmonic oscillator basis has recently been
presented @Phys. Rev. A 63, 052111 ~2001!#. In the present paper, we propose a generalization of that formalism
which does not rely on the harmonic oscillator for the inclusion of the continuum in the study of weakly
bound systems. In particular, we construct wave functions that represent the continuum by making use of
families of orthogonal polynomials whose weight function is the square of the ground state wave function,
expressed in terms of a suitably scaled variable. As an illustration, the formalism is applied to one-dimensional
Morse, Po¨schl-Teller, and square well potentials. We show how the method can deal with potentials having
several bound states, and for the square well case we present a comparison of the discretized and exact
continuum wave functions.