How can I parse a 7-segment number made of the characters `_` and `|` into an integer?

How can I parse a 7-segment number made of the characters _ and | into an integer?

Input :

  _  _     _  _  _  _  _    
| _| _||_||_ |_   ||_||_|   
||_  _|  | _||_|  ||_| _|   

Output :

123456789