Text this: Cons-training tensor networks: Embedding and optimization over discrete linear constraints