If a line segment is completely inside a polygon, then there will be at least 1 polygon vertex on either sides of the line.
See How to tell whether a point is to the right or left side of a line for finding which side a point is on.
UPDATE:
However, the vice-versa may not be true. One should traverse all the polygon vertices in order starting from one end of the line segment. All vertices encountered in traversal from start to end of line segment should be on one side and the remaining should be on the other side.
The above will not be true if the line segment coincides with one of the edges of the polygon. In that case, there will be no vertex on one side of the line. However, in this case, the line is not lying completely inside the polygon either.