This package exposes the floor-plan-parser CLI. To install it, run:
uv syncRun the floor-plan parser, bu passing a floor-plan file:
uv run floor-plan-parser rooms.txt- Company: Apartment And Chair Delivery Limited (AACD)
- Automate reading floor plans and counting number of different chairs
- Output the number of different chair types for apartment and per room
- Total first, rooms sorted alphabetically
- CLI to read floor plan file and print result
- W: wooden
- P: plastic
- S: sofa
- C: china
total:
W: 3, P: 2, S: 0, C: 0
living room:
W: 3, P: 0, S: 0, C: 0
office:
W: 0, P: 2, S: 0, C: 0
- Walls chars:
+-|/\ - Room names lower case in parenthesis,
\([a-z\s]+\), within room - Chair positions marked as uppercase first char of type,
[WPSC]
Apartment: floor plan, collection of rooms, method to sum chair countsRoom: name, floor plan mask, count of chairs by chair typeChairType: enum
- Convert text file to 2d char array, init apartment floor plan
- Find all room names using regex, remember position at middle of name
- Find all chairs using type char regex, remember position
- Find all rooms by flood-filling the floor plan, identifying islands of non-wall chars
- Create 2d bool array map mask for each room
- Identify rooms by matching room name positions to room map masks
- Assign chairs by matching chair positions to room map masks
- Init and return entities
- Command line controller
- Triggered by CLI call
- Read floor plan file
- Call floor plan parser
- Presenter for legacy system
- Used by floor plan parser
- Convert result into output template
- Pass to CLI output port
- Simple argparse CLI, file path as parameter
- Pass file path to command line controller
- Print output of controller