Searching for r-process-enhanced stars in the LAMOST survey I: the method