Consider the following 3 strings:
1tb hdd 256gb ssd
hdd 256gb
1tb hdd
If you know, that all of these strings are part of a product title, specifically part of the title of a Laptop product, a human can easily read these out, and understand that the specific laptop for which the respective string is part of has either hdd/ssd disk in it, and if it has, he can also decide the capacity of the said disk.
Is there any way to programatically make the same assumption correctly?
I am trying to parse the attributes of some products from their titles, and this exact problem arose: some titles have the ordering of {disktype} {capacity}
, some have the ordering of {capacity} {disktype}
, and I can't figure out a way to correctly identify the order, so that I can correctly parse the attribute and the data. In some cases, the titles contain ,
characters, which is very helpful in this situation, but there are a few cases where there are no other delimiters except \s
characters.
To make things worse, some product titles only contain the following structure: 1tb ssd 512gb
. Based on the human understanding, and the context of the above string, for a human, it is still decidable which type of hard disk the laptop contains, and what capacity does it have, but can a computer do this programaticaly in a safe way also?
1tb ssd 512gb
where the larger capacity is implied to be the hdd in the product - for that, my separation algorithm will imply that the product only containsssd
in it, and will still fail $\endgroup$