When creating a password generator, use a cryptographically secure pseudo-random number generator (CSPRNG) and trust in the random properties of that system.
Rather than checking if a randomly generated password contains a substring that humans might recognize as a word, instead check that the entire password has not been part of a data breach.
The current biggest threat to passwords are offline attacks against data dumps. Passwords should be stored using a key stretching algorithm, such as PBKDF2, bcrypt, scrypt, or Argon2, which makes it impossible to pre-build lookup tables and greatly increase the time that it takes to attack the passwords.
Additionally, these key stretching algorithms have an avalanche effect: A minor change in any of the inputs will make a huge difference in the output. (Caveat: With an infinite input space and a finite output space, there will be collisions.) Cryptographic hashing algorithms also have this feature. Thus, attackers can not tell how close they're getting to cracking your password, like they can in movies.
Thus, unless you've somehow told your attackers that password contains the word 'password', then it doesn't matter if there are human readable words that happen to appear in the middle of your generated password.
The current largest threat is from attackers that use dictionary attacks based on previously leaked passwords, because they know that users will reuse passwords, and will use known weak passwords in throwaway accounts. The way to mitigate this, according to the NIST standards, is to check the whole of the password against a list of known bad passwords, such as dictionary words, expected patterns, and compromised passwords.
The NIST standard puts the onus of keeping users from using known bad passwords on the site owners, but there is nothing preventing your generator from using a service such as the Pwned Passwords API in the astronomically unlikely (but technically possible) event that your generator using a CSPRNG produces a password that has been leaked elsewhere.