oh-my-ocr / text_renderer

https://oh-my-ocr.github.io/text_renderer/README.html
MIT License
789 stars 161 forks source link

Apply principle of least surprise to OneOf #27

Closed ELanning closed 3 years ago

ELanning commented 3 years ago
OneOf([
     DropOutRand(p=0.1),
     Line(p=0.4),
])

Expected: Select one of DropOutRand or Line and invoke it with the given probability (10% or 40%). Actual: Select one of DroupOutRand or Line and invoke it with 100% probability.

This PR changes Actual to Expected, and allows OneOf to be used as an Effect.

Sanster commented 3 years ago

fixed in https://github.com/oh-my-ocr/text_renderer/commit/036e6d32b00aeac1384e471ba6d34a9643a762b2.

Not sure if OneOf should be turned into an Effect or not. Remain unchanged for now